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


Java IArchiveExtractCallback类代码示例

本文整理汇总了Java中SevenZip.Archive.IArchiveExtractCallback的典型用法代码示例。如果您正苦于以下问题:Java IArchiveExtractCallback类的具体用法?Java IArchiveExtractCallback怎么用?Java IArchiveExtractCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Init

import SevenZip.Archive.IArchiveExtractCallback; //导入依赖的package包/类
public int Init(
        ArchiveDatabaseEx archiveDatabase,
        int ref2Offset,
        int startIndex,
        BoolVector extractStatuses,
        IArchiveExtractCallback extractCallback,
        boolean testMode) throws java.io.IOException {
    _archiveDatabase = archiveDatabase;
    _ref2Offset = ref2Offset;
    _startIndex = startIndex;
    
    _extractStatuses = extractStatuses;
    _extractCallback = extractCallback;
    _testMode = testMode;
    
    _currentIndex = 0;
    _fileIsOpen = false;
    return WriteEmptyFiles();
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:20,代码来源:FolderOutStream.java

示例2: testOrExtract

import SevenZip.Archive.IArchiveExtractCallback; //导入依赖的package包/类
static void testOrExtract(IInArchive archive,Vector<String> listOfNames,int mode) throws Exception {
    
    ArchiveExtractCallback extractCallbackSpec = new ArchiveExtractCallback();
    IArchiveExtractCallback extractCallback = extractCallbackSpec;
    extractCallbackSpec.Init(archive);
    extractCallbackSpec.PasswordIsDefined = false;
    
    try {  
        int len = 0;
        int arrays []  = null;
        
        if (listOfNames.size() >= 1) {
            arrays = new int[listOfNames.size()];
            for(int i = 0 ; i < archive.size() ; i++) {
                if (listOfNames.contains(archive.getEntry(i).getName())) {
                    arrays[len++] = i;
                }
            }
        }
            
        int res;
        
        if (len == 0) {
            res = archive.Extract(null, -1, mode , extractCallback);
        } else {
            res = archive.Extract(arrays, len, mode, extractCallback);
        }
        
        if (res == HRESULT.S_OK) {
            if (extractCallbackSpec.NumErrors == 0)
                System.out.println("Ok Done");
            else
                System.out.println(" " + extractCallbackSpec.NumErrors + " errors");
        } else {
            System.out.println("ERROR !!");
        }
    } catch (java.io.IOException e) {
        System.out.println("IO error : " + e.getLocalizedMessage());
    }
}
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:41,代码来源:J7zip.java

示例3: testOrExtract

import SevenZip.Archive.IArchiveExtractCallback; //导入依赖的package包/类
static void testOrExtract(IInArchive archive,Vector<String> listOfNames,int mode, String parent_dir) throws Exception {
    
    ArchiveExtractCallback extractCallbackSpec = new ArchiveExtractCallback();
    IArchiveExtractCallback extractCallback = extractCallbackSpec;
    extractCallbackSpec.Init(archive);
    extractCallbackSpec.PasswordIsDefined = false;
    
    try {  
        int len = 0;
        int arrays []  = null;
                        
        int res;
        
        if (len == 0) {
          // Updated to pass parent_dir argument [GAB, OpenLogic 2013-10-28]
            res = archive.Extract(null, -1, mode , extractCallback, parent_dir);
        } else {
          // Updated to pass parent_dir argument [GAB, OpenLogic 2013-10-28]
            res = archive.Extract(arrays, len, mode, extractCallback, parent_dir);
        }
        
        if (res == HRESULT.S_OK) {
            if (extractCallbackSpec.NumErrors == 0)
                System.out.println("Ok Done");
            else
                System.out.println(" " + extractCallbackSpec.NumErrors + " errors");
        } else {
            System.out.println("ERROR !!");
            throw new Invalid7zArchiveException("Invalid 7z archive");
        }
    } catch (java.io.IOException e) {
        System.out.println("IO error : " + e.getLocalizedMessage());
    }
}
 
开发者ID:sialan-labs,项目名称:Meikade,代码行数:35,代码来源:J7zip.java

示例4: extractAppCache

import SevenZip.Archive.IArchiveExtractCallback; //导入依赖的package包/类
public void extractAppCache(SevenZip.IInStream istream, String outputPath) throws IOException
{
	// create outputPath if needed
	File folder = new File(outputPath);
	boolean success = true;
       if(!folder.exists()){
           success = folder.mkdirs();
       }
       if (!success){ 
           Log.d(TAG,"Folder not created.");
       }
       else{
           Log.d(TAG,"Folder created!");
       }		
	
	
	//RemoteAppCacheRandomAccessFile istream = new RemoteAppCacheRandomAccessFile(inputFile,"r");
       
       IInArchive archive = new Handler();
       
       int ret = archive.Open( istream );
       
       if (ret != 0) {
           System.out.println("ERROR !");
           return ;
       }
       
       //Vector<String> listOfNames = new Vector<String>();		
	
   	RemoteAppCacheArchiveExtractCallback extractCallbackSpec = new RemoteAppCacheArchiveExtractCallback(outputPath);
       IArchiveExtractCallback extractCallback = extractCallbackSpec;
       extractCallbackSpec.Init(archive);
       extractCallbackSpec.PasswordIsDefined = false;
       
       try {  
           int len = 0;
           int arrays []  = null;
           
          /* if (listOfNames.size() >= 1) {
               arrays = new int[listOfNames.size()];
               for(int i = 0 ; i < archive.size() ; i++) {
                   if (listOfNames.contains(archive.getEntry(i).getName())) {
                       arrays[len++] = i;
                   }
               }
           }*/
               
           int res;
           
           //if (len == 0) {
               res = archive.Extract(null, -1, IInArchive.NExtract_NAskMode_kExtract , extractCallback);
           //} else {
           //    res = archive.Extract(arrays, len, mode, extractCallback);
           //}
           
           if (res == HRESULT.S_OK) {
               if (extractCallbackSpec.NumErrors == 0)
                   System.out.println("Ok Done");
               else
                   System.out.println(" " + extractCallbackSpec.NumErrors + " errors");
           } else {
               System.out.println("ERROR !!");
           }
       } catch (java.io.IOException e) {
           System.out.println("IO error : " + e.getLocalizedMessage());
       }
       
       archive.close();
   }
 
开发者ID:Mobideck,项目名称:appdeck-android,代码行数:70,代码来源:RemoteAppCache.java


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