Modifier and Type | Field and Description |
---|---|
static char |
BACK_SLASH |
static int |
BUF_SIZE |
static char |
FORWARD_SLASH |
Constructor and Description |
---|
Zip()
Creates a new Zip instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addArchiveListener(ArchiveListener listener)
Adds listener.
|
void |
compress(java.io.File file)
Creates a new ZIP archive.
|
void |
compress(java.io.File file,
java.io.File targetPath)
Creates a new ZIP archive.
|
void |
compress(java.io.File output,
java.util.Vector sourceVector)
Expects a Vector of files and zips the content to the output file
|
void |
decompress(java.io.File file)
Decompress all the files in given ZIP archive.
|
void |
decompress(java.io.File file,
java.io.File output)
Decompress all the files in given ZIP archive.
|
static java.util.Vector |
getList(java.lang.String sDir)
Recursively calculates the list of files.
|
long |
getSize(java.util.Vector files)
Get size of files in Vector
|
void |
interrupt()
Interrupt this instance & stop any ongoing compression / decompression.
|
boolean |
isInterrupted()
Returns whether this instance has been interrupted.
|
void |
removeArchiveListener(ArchiveListener listener)
Removes listener.
|
void |
reset()
Reset the interrupted flag.
|
public static final char FORWARD_SLASH
public static final char BACK_SLASH
public static final int BUF_SIZE
public void compress(java.io.File file) throws ArchiveException
compress
in interface Archive
file
- the input fileArchiveException
- if error occurspublic void compress(java.io.File file, java.io.File targetPath) throws ArchiveException
compress
in interface Archive
file
- the input filetargetPath
- the output file or directoryArchiveException
- if error occurspublic void interrupt()
public void reset()
public boolean isInterrupted()
public void compress(java.io.File output, java.util.Vector sourceVector) throws ArchiveException
sourceVector
- output
- ArchiveException
public long getSize(java.util.Vector files)
files
- target filespublic static java.util.Vector getList(java.lang.String sDir)
sDir
- public void decompress(java.io.File file) throws ArchiveException
decompress
in interface Archive
file
- the ZIP fileArchiveException
- if error occurspublic void decompress(java.io.File file, java.io.File output) throws ArchiveException
decompress
in interface Archive
file
- the ZIP fileoutput
- the output directory to decompress files toArchiveException
- if error occurspublic void addArchiveListener(ArchiveListener listener)
addArchiveListener
in interface Archive
listener
- the listenerArchive.addArchiveListener(ArchiveListener)
public void removeArchiveListener(ArchiveListener listener)
removeArchiveListener
in interface Archive
listener
- the listenerArchive.removeArchiveListener(ArchiveListener)
Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved