Spreadsheet Toolkit

corpus.fileIO
Class ZipInfo

java.lang.Object
  |
  +--corpus.fileIO.ZipInfo

public class ZipInfo
extends java.lang.Object

Dumps info about a zip file.

See Also:
Zip, Unzip, Unzip.showEntries(ZipFile)

Constructor Summary
ZipInfo(java.lang.String path)
           
ZipInfo(java.util.zip.ZipFile zipfile)
           
 
Method Summary
 void close()
           
static double compressionLevel(byte[] data)
          Calculates the packed and unpacked size of the zip file and returns the compression ratio as a percentage (2 d.p.)
static double compressionLevel(java.lang.String path)
          Calculates the packed and unpacked size of the zip file and returns the compression ratio as a percentage (2 d.p.)
static void main(java.lang.String[] args)
           
 void print()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZipInfo

public ZipInfo(java.util.zip.ZipFile zipfile)

ZipInfo

public ZipInfo(java.lang.String path)
        throws java.io.IOException
Method Detail

print

public void print()

close

public void close()
           throws java.io.IOException
java.io.IOException

compressionLevel

public static double compressionLevel(java.lang.String path)
                               throws java.io.IOException
Calculates the packed and unpacked size of the zip file and returns the compression ratio as a percentage (2 d.p.)

Parameters:
path - The file system path to a zip file.
Returns:
The compression level as a percentage rounded to 2 d.p.
java.io.IOException

compressionLevel

public static double compressionLevel(byte[] data)
                               throws java.io.IOException
Calculates the packed and unpacked size of the zip file and returns the compression ratio as a percentage (2 d.p.)

Returns:
The compression level as a percentage rounded to 2 d.p.
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception

Spreadsheet Toolkit

Project Home Page