|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.myjavaworld.zip.Zip
public class Zip
This class is used to create ZIP files.
Constructor Summary | |
---|---|
Zip(File file)
Creates an instance of ZipFile . |
Method Summary | |
---|---|
void |
addEntry(File file)
Adds a new entry to this ZipFile . |
void |
addProgressListener(ProgressListener l)
|
void |
addZipListener(ZipListener l)
|
void |
close()
Closes this ZipFile . |
protected void |
fireBeginFileEvent(File file)
|
protected void |
fireEndFileEvent(File file)
|
protected void |
fireProgressEvent(int progress)
|
File |
getFile()
|
com.myjavaworld.util.Filter |
getFilter()
|
File |
getRelativeTo()
Returns the directory, relative to which the entries will be added to this zip file. |
void |
open()
Opens this ZipFile for writing. |
void |
removeProgressListener(ProgressListener l)
|
void |
removeZipListener(ZipListener l)
|
void |
setFilter(com.myjavaworld.util.Filter filter)
|
void |
setRelativeTo(File relativeTo)
Sets the directory, relative to which all entries will be added to the zip file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Zip(File file)
ZipFile
.
file
- compressed file to createMethod Detail |
---|
public File getFile()
public void setFilter(com.myjavaworld.util.Filter filter)
public com.myjavaworld.util.Filter getFilter()
public void addZipListener(ZipListener l)
public void removeZipListener(ZipListener l)
public void addProgressListener(ProgressListener l)
public void removeProgressListener(ProgressListener l)
protected void fireBeginFileEvent(File file)
protected void fireEndFileEvent(File file)
protected void fireProgressEvent(int progress)
public File getRelativeTo()
public void setRelativeTo(File relativeTo)
relativeTo
- directory, relative to which the entries will be added.public void open() throws IOException
ZipFile
for writing. This method must be called
before adding any entries to this CompressedFile
.
IOException
- propogated.public void close() throws IOException
ZipFile
. No more entries can be added to this
ZipFile
after calling this method. An attempt to add more
entries after calling this method will result in an
IllegalStateException
.
IOException
- propogated.public void addEntry(File file) throws IOException
ZipFile
.
file
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |