当前位置: 首页>>代码示例>>Java>>正文


Java IInArchive.NExtract_NAskMode_kExtract方法代码示例

本文整理汇总了Java中SevenZip.Archive.IInArchive.NExtract_NAskMode_kExtract方法的典型用法代码示例。如果您正苦于以下问题:Java IInArchive.NExtract_NAskMode_kExtract方法的具体用法?Java IInArchive.NExtract_NAskMode_kExtract怎么用?Java IInArchive.NExtract_NAskMode_kExtract使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SevenZip.Archive.IInArchive的用法示例。


在下文中一共展示了IInArchive.NExtract_NAskMode_kExtract方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: PrepareOperation

import SevenZip.Archive.IInArchive; //导入方法依赖的package包/类
public int PrepareOperation(int askExtractMode) {
    _extractMode = false;
    switch (askExtractMode) {
        case IInArchive.NExtract_NAskMode_kExtract:
            _extractMode = true;
    };
    switch (askExtractMode) {
        case IInArchive.NExtract_NAskMode_kExtract:
            PrintString("Extracting  ");
            break;
        case IInArchive.NExtract_NAskMode_kTest:
            PrintString("Testing     ");
            break;
        case IInArchive.NExtract_NAskMode_kSkip:
            PrintString("Skipping    ");
            break;
    };
    PrintString(_filePath);
    return HRESULT.S_OK;
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:21,代码来源:ArchiveExtractCallback.java

示例2: OpenFile

import SevenZip.Archive.IInArchive; //导入方法依赖的package包/类
int OpenFile() throws java.io.IOException {
    int askMode;
    if(_extractStatuses.get(_currentIndex))
        askMode = _testMode ?
            IInArchive.NExtract_NAskMode_kTest :
            IInArchive.NExtract_NAskMode_kExtract;
    else
        askMode = IInArchive.NExtract_NAskMode_kSkip;
    
    
    int index = _startIndex + _currentIndex;
    
    // RINOK(_extractCallback->GetStream(_ref2Offset + index, &realOutStream, askMode));
    java.io.OutputStream [] realOutStream2 = new java.io.OutputStream[1]; // TBD
    int ret = _extractCallback.GetStream(_ref2Offset + index, realOutStream2, askMode);
    if (ret != HRESULT.S_OK) return ret;
     
    java.io.OutputStream realOutStream = realOutStream2[0];
    
    _outStreamWithHashSpec.SetStream(realOutStream);
    _outStreamWithHashSpec.Init();
    if (askMode == IInArchive.NExtract_NAskMode_kExtract &&
            (realOutStream == null)) {
        FileItem fileInfo = _archiveDatabase.Files.get(index);
        if (!fileInfo.IsAnti && !fileInfo.IsDirectory)
            askMode = IInArchive.NExtract_NAskMode_kSkip;
    }
    return _extractCallback.PrepareOperation(askMode);
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:30,代码来源:FolderOutStream.java

示例3: OpenFile

import SevenZip.Archive.IInArchive; //导入方法依赖的package包/类
int OpenFile(java.io.File parent_dir) throws java.io.IOException {
    int askMode;
    if(_extractStatuses.get(_currentIndex))
        askMode = _testMode ?
            IInArchive.NExtract_NAskMode_kTest :
            IInArchive.NExtract_NAskMode_kExtract;
    else
        askMode = IInArchive.NExtract_NAskMode_kSkip;
    
    
    int index = _startIndex + _currentIndex;
    
    // RINOK(_extractCallback->GetStream(_ref2Offset + index, &realOutStream, askMode));
    java.io.OutputStream [] realOutStream2 = new java.io.OutputStream[1]; // TBD

    // Updated to pass parent_dir argument [GAB, OpenLogic 2013-10-28]
    int ret = _extractCallback.GetStream(_ref2Offset + index, realOutStream2, askMode, parent_dir);
    if (ret != HRESULT.S_OK) return ret;
     
    java.io.OutputStream realOutStream = realOutStream2[0];
    
    _outStreamWithHashSpec.SetStream(realOutStream);
    _outStreamWithHashSpec.Init();
    if (askMode == IInArchive.NExtract_NAskMode_kExtract &&
            (realOutStream == null)) {
        FileItem fileInfo = _archiveDatabase.Files.get(index);
        if (!fileInfo.IsAnti && !fileInfo.IsDirectory)
            askMode = IInArchive.NExtract_NAskMode_kSkip;
    }
    return _extractCallback.PrepareOperation(askMode);
}
 
开发者ID:sialan-labs,项目名称:Meikade,代码行数:32,代码来源:FolderOutStream.java

示例4: GetStream

import SevenZip.Archive.IInArchive; //导入方法依赖的package包/类
public int GetStream(int index,
            java.io.OutputStream [] outStream,
            int askExtractMode) throws java.io.IOException {
        
        outStream[0] = null;
        
        SevenZipEntry item = _archiveHandler.getEntry(index);
        _filePath = item.getName();
        
        if (extractDir != null)
        {
        	_filePath = extractDir + _filePath;
        }
        
        //AppDeck appDeck = AppDeck.getInstance();
        //_filePath = appDeck.cacheDir + _filePath;
        
/*        Context context = getA
        File httpCacheDir = new File(context.getCacheDir(), "http");
        _filePath = httpCacheDir + _filePath;*/
        
        File file = new File(_filePath);
        
        switch (askExtractMode) {
            case IInArchive.NExtract_NAskMode_kTest:
                return HRESULT.S_OK;
                
            case IInArchive.NExtract_NAskMode_kExtract:
                
                try {
                    isDirectory = item.isDirectory();
                    
                    if (isDirectory) {
                        if (file.isDirectory()) {
                            return HRESULT.S_OK;
                        }
                        if (file.mkdirs())
                            return HRESULT.S_OK;
                        else
                            return HRESULT.S_FALSE;
                    }
                    
                    
                    File dirs = file.getParentFile();
                    if (dirs != null) {
                        if (!dirs.isDirectory())
                            if (!dirs.mkdirs())
                                return HRESULT.S_FALSE;
                    }
                    
                    long pos = item.getPosition();
                    if (pos == -1) {
                        file.delete();
                    }
                    
                    java.io.RandomAccessFile outStr = new java.io.RandomAccessFile(_filePath,"rw");
                    
                    if (pos != -1) {
                        outStr.seek(pos);
                    }
                    
                    outStream[0] = new OutputStream(outStr);
                } catch (java.io.IOException e) {
                    return HRESULT.S_FALSE;
                }
                
                return HRESULT.S_OK;
                
        }
        
        // other case : skip ...
        
        return HRESULT.S_OK;
        
    }
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:76,代码来源:ArchiveExtractCallback.java

示例5: GetStream

import SevenZip.Archive.IInArchive; //导入方法依赖的package包/类
public int GetStream(int index,
        java.io.OutputStream [] outStream,
        int askExtractMode) throws java.io.IOException {
    
    outStream[0] = null;
    
    SevenZipEntry item = _archiveHandler.getEntry(index);
    _filePath = item.getName();
    
    _filePath = _outputPath + "/" + _filePath;
    
    File file = new File(_filePath);
    
    switch (askExtractMode) {
        case IInArchive.NExtract_NAskMode_kTest:
            return HRESULT.S_OK;
            
        case IInArchive.NExtract_NAskMode_kExtract:
            
            try {
                isDirectory = item.isDirectory();
                
                if (isDirectory) {
                    if (file.isDirectory()) {
                        return HRESULT.S_OK;
                    }
                    if (file.mkdirs())
                        return HRESULT.S_OK;
                    else
                        return HRESULT.S_FALSE;
                }
                
                
                File dirs = file.getParentFile();
                if (dirs != null) {
                    if (!dirs.isDirectory())
                        if (!dirs.mkdirs())
                            return HRESULT.S_FALSE;
                }
                
                long pos = item.getPosition();
                if (pos == -1) {
                    file.delete();
                }
                
                java.io.RandomAccessFile outStr = new java.io.RandomAccessFile(_filePath,"rw");
                
                if (pos != -1) {
                    outStr.seek(pos);
                }
                
                outStream[0] = new OutputStream(outStr);
            } catch (java.io.IOException e) {
                return HRESULT.S_FALSE;
            }
            
            return HRESULT.S_OK;
            
    }
    
    // other case : skip ...
    
    return HRESULT.S_OK;
    
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:66,代码来源:RemoteAppCache.java

示例6: GetStream

import SevenZip.Archive.IInArchive; //导入方法依赖的package包/类
public int GetStream(int index,
        java.io.OutputStream [] outStream,
        // Updated to pass parent_dir argument [GAB, OpenLogic 2013-10-28]
        int askExtractMode, java.io.File parent_dir) throws java.io.IOException {
    
    outStream[0] = null;
    
    SevenZipEntry item = _archiveHandler.getEntry(index);
    _filePath = item.getName();
    
    // Updated to create the extracted file under the parent_dir directory [GAB, OpenLogic 2013-10-28]
    File file = new File(parent_dir, _filePath);
    
    switch (askExtractMode) {
        case IInArchive.NExtract_NAskMode_kTest:
            return HRESULT.S_OK;
            
        case IInArchive.NExtract_NAskMode_kExtract:
            
            try {
                isDirectory = item.isDirectory();
                
                if (isDirectory) {
                    if (file.isDirectory()) {
                        return HRESULT.S_OK;
                    }
                    if (file.mkdirs())
                        return HRESULT.S_OK;
                    else
                        return HRESULT.S_FALSE;
                }
                
                
                File dirs = file.getParentFile();
                if (dirs != null) {
                    if (!dirs.isDirectory())
                        if (!dirs.mkdirs())
                            return HRESULT.S_FALSE;
                }
                
                long pos = item.getPosition();
                if (pos == -1) {
                    file.delete();
                }
                
                // Write the extracted contents to the file under the parent_dir directory [GAB, OpenLogic 2013-10-28]
                java.io.RandomAccessFile outStr = new java.io.RandomAccessFile(file,"rw");
                
                if (pos != -1) {
                    outStr.seek(pos);
                }
                
                outStream[0] = new OutputStream(outStr);
            } catch (java.io.IOException e) {
                return HRESULT.S_FALSE;
            }
            
            return HRESULT.S_OK;
            
    }
    
    // other case : skip ...
    
    return HRESULT.S_OK;
    
}
 
开发者ID:sialan-labs,项目名称:Meikade,代码行数:67,代码来源:ArchiveExtractCallback.java


注:本文中的SevenZip.Archive.IInArchive.NExtract_NAskMode_kExtract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。