|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jfw.file.UnzipFile
public final class UnzipFile
Unzip a file.
If the zip file has been created using the encryption method offered in
ZipFile then you can decrypt the zip file by setting the
decryption key (method setKey4Decryption(java.lang.String)) before to use
the extract(java.lang.String, boolean) method.
| Constructor Summary | |
|---|---|
UnzipFile(java.lang.String name)
Create an instance. |
|
UnzipFile(java.lang.String path,
java.lang.String name)
Create an instance. |
|
| Method Summary | |
|---|---|
void |
addFile(java.lang.String name)
Add the name of a file to extract. |
void |
decrypt(java.lang.String file2Decrypt)
Decrypt a zip. |
void |
extract(java.lang.String path)
Extract all file form the zip file. |
void |
extractFiles(java.lang.String path)
Extract the only files set in method addFile(java.lang.String). |
byte[] |
getFile(java.lang.String fileName)
Get a file from the zip file. |
java.lang.String[] |
listFiles()
Get the names of files in the zip file. |
void |
setKey4Decryption(java.lang.String key4Decryption)
Set the decryption key of the zipped files. |
java.lang.String |
toString()
Return log informations relative of the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UnzipFile(java.lang.String name)
name - path and name, with extension, of zip file.
public UnzipFile(java.lang.String path,
java.lang.String name)
path - the path of the zip file.name - name, with extension, of zip file.| Method Detail |
|---|
public void setKey4Decryption(java.lang.String key4Decryption)
key4Decryption - the decryption key.public void addFile(java.lang.String name)
name - the absolute path+name of the file to extract.
public void extract(java.lang.String path)
throws JFWGenericException
path - the path to unzip the file.
JFWGenericException
public void extractFiles(java.lang.String path)
throws JFWGenericException
addFile(java.lang.String).
path - the path to unzip the file.
JFWGenericException
public byte[] getFile(java.lang.String fileName)
throws JFWGenericException
decrypt(java.lang.String) method.
fileName - the name of the file to get.
JFWGenericException
public void decrypt(java.lang.String file2Decrypt)
throws JFWGenericException
TMP_EXT. For example, if the original name is
"myfile.zip" the decrypted file name will be "myfile.zip.dec".
Note that the original file is not deleted after decryption.
file2Decrypt - the absolute path and name of the file to decrypt.
JFWGenericException
public java.lang.String[] listFiles()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||