Package SevenZip.Archive

Examples of SevenZip.Archive.SevenZipEntry


             }
         }
        
        @Override
         public OutputStream GetStream(final int index, final int askExtractMode) throws IOException {
             final SevenZipEntry item = super.archiveHandler.getEntry(index);
             super.filePath = item.getName();
             this.cfos = (item.isDirectory()) ? null : new ByteArrayOutputStream();
             return this.cfos;
         }
View Full Code Here


             }
         }

        @Override
         public OutputStream GetStream(final int index, final int askExtractMode) throws IOException {
             final SevenZipEntry item = super.archiveHandler.getEntry(index);
             super.filePath = item.getName();
             this.cfos = (item.isDirectory()) ? null : new ByteArrayOutputStream();
             return this.cfos;
         }
View Full Code Here

        System.out.println();
    }
   
    public OutputStream GetStream(int index, int askExtractMode) throws IOException {
        RAOutputStream r = null;
        SevenZipEntry item = this.archiveHandler.getEntry(index);
        this.filePath = item.getName();
       
        File file;
        if (this.exractPath == null) {
          file = new File(this.filePath);
        } else {
          file = new File(this.exractPath, this.filePath);
        }
        this.diskFilePath = file.getAbsolutePath();
       
        if (askExtractMode == IInArchive.NExtract_NAskMode_kExtract) {
            if (this.isDirectory = item.isDirectory()) {
              if (!file.isDirectory() && !file.mkdirs())
                throw new IOException("failed to make directories: " + file);
                return null;
            }
           
            File dirs = file.getParentFile();
            if (dirs != null && !dirs.isDirectory() && !dirs.mkdirs()) {
              throw new IOException("failed to make directories: " + dirs);
            }
           
            long pos = item.getPosition();
            if (pos == -1) {
                file.delete();
            }
           
            RandomAccessFile outStr = new RandomAccessFile(file, "rw");
View Full Code Here

        long size = 0;
        long packSize = 0;
        long nbFiles = 0;
       
        for(int i = 0; i < archive.size() ; i++) {
            SevenZipEntry item = archive.getEntry(i);
           
            DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.SHORT , DateFormat.SHORT );
            String str_tm = formatter.format(new java.util.Date(item.getTime()));
           
            if (listOfNames.contains(item.getName())) {
                if (techMode) {
                    System.out.println("Path = " + item.getName());
                    System.out.println("Size = " + item.getSize());
                    System.out.println("Packed Size = " + item.getCompressedSize());
                    System.out.println("Modified = " + str_tm);
                    System.out.println("   Attributes : " + item.getAttributesString());
                    long crc = item.getCrc();
                    if (crc != -1)
                        System.out.println("CRC = " + Long.toHexString(crc).toUpperCase());
                    else
                        System.out.println("CRC =");
                    System.out.println("Method = " + item.getMethods() );
                    System.out.println("" );
                   
                } else {
                    System.out.print(str_tm + " " + item.getAttributesString());
                   
                    System.out.print(item.getSize());
                   
                    System.out.print(item.getCompressedSize());
                   
                    System.out.println("  " + item.getName());
                }
               
                size += item.getSize();
                packSize += item.getCompressedSize();
                nbFiles ++;
            }
        }
       
        if (!techMode) {
View Full Code Here

        return new String();
    }
   
    public SevenZipEntry getEntry(int index) {
        SevenZip.Archive.SevenZip.FileItem item = (FileItem)_database.Files.get(index);
        return new SevenZipEntry(
                item.name,
                getPackSize(index),
                item.UnPackSize,
                (item.IsFileCRCDefined) ? item.FileCRC & 0xFFFFFFFFL : -1,
                item.LastWriteTime,
View Full Code Here

TOP

Related Classes of SevenZip.Archive.SevenZipEntry

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.