Package SevenZip.Archive.SevenZip

Examples of SevenZip.Archive.SevenZip.Handler


                (Object)null,
                null,
                null,
                null,
                false);
        Handler archive;
        super.log.logFine("opening 7zip archive...");
        try {
            archive = new Handler(source);
        } catch (final IOException e) {
            throw new Parser.Failure("error opening 7zip archive: " + e.getMessage(), location);
        }
        final SZParserExtractCallback aec = new SZParserExtractCallback(super.log, archive,
                doc, location.getFile());
        super.log.logFine("processing archive contents...");
        try {
            archive.Extract(null, -1, 0, aec);
            return doc;  
        } catch (final IOException e) {
            if (e.getCause() instanceof InterruptedException)
                throw (InterruptedException)e.getCause();
            if (e.getCause() instanceof Parser.Failure)
                throw (Parser.Failure)e.getCause();
            throw new Parser.Failure(
                    "error processing 7zip archive at internal file " + aec.getCurrentFilePath() + ": " + e.getMessage(),
                    location);
        } finally {
            try { archive.close(); } catch (final IOException e) {  }
        }
    }
View Full Code Here


                (Object)null,
                null,
                null,
                null,
                false);
        Handler archive;
        super.log.logFine("opening 7zip archive...");
        try {
            archive = new Handler(source);
        } catch (final IOException e) {
            throw new Parser.Failure("error opening 7zip archive: " + e.getMessage(), location);
        }
        final SZParserExtractCallback aec = new SZParserExtractCallback(super.log, archive,
                doc, location.getFile());
        super.log.logFine("processing archive contents...");
        try {
            archive.Extract(null, -1, 0, aec);
            return doc;
        } catch (final IOException e) {
            if (e.getCause() instanceof InterruptedException)
                throw (InterruptedException)e.getCause();
            if (e.getCause() instanceof Parser.Failure)
                throw (Parser.Failure)e.getCause();
            throw new Parser.Failure(
                    "error processing 7zip archive at internal file " + aec.getCurrentFilePath() + ": " + e.getMessage(),
                    location);
        } finally {
            try { archive.close(); } catch (final IOException e) {  }
        }
    }
View Full Code Here

       
        String filename = args[1];
       
        MyRandomAccessFile istream = new MyRandomAccessFile(filename,"r");
       
        IInArchive archive = new Handler(istream);
       
       
        switch(mode) {
            case MODE_LISTING:
                listing(archive,listOfNames,false);
                break;
            case MODE_TESTING:
                testOrExtract(archive,listOfNames,IInArchive.NExtract_NAskMode_kTest);
                break;
            case MODE_EXTRACT:
                testOrExtract(archive,listOfNames,IInArchive.NExtract_NAskMode_kExtract);
                break;
        }
       
        archive.close();
    }
View Full Code Here

TOP

Related Classes of SevenZip.Archive.SevenZip.Handler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.