當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。