|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jomic.tools.FileArchive
public class FileArchive
An archive containing files. Currently supported formats are ZIP and RAR.
For hints and implementation details on various archive formats, see for example Marco Schmidt's list of archive file formats and archivers .
Constructor Summary | |
---|---|
FileArchive(java.io.File newFile)
|
Method Summary | |
---|---|
void |
extract(java.io.File targetDir,
java.lang.String[] fileNamesToExtract)
|
void |
extract(java.io.File targetDir,
java.lang.String[] fileNamesToExtract,
ProgressFrame progressFrame,
long progressIncrement)
Extract to targetDir all files in fileNamesToExtract . |
java.lang.String |
getBaseName()
Get the plain name of the archive file, without directory and suffix. |
java.lang.String |
getFileType()
Get the file type of the archive. |
java.lang.String[] |
list()
|
void |
removeExtracted(java.io.File targetDir)
Attempt to remove all files that could have been extracted from the archive to targetDir
. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileArchive(java.io.File newFile) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public java.lang.String getBaseName()
public java.lang.String getFileType()
public void extract(java.io.File targetDir, java.lang.String[] fileNamesToExtract, ProgressFrame progressFrame, long progressIncrement) throws java.io.IOException
targetDir
all files in fileNamesToExtract
. If progressFrame
is not null, advance its progress bar by progressIncrement
for every file that
is extracted.
java.io.IOException
public void extract(java.io.File targetDir, java.lang.String[] fileNamesToExtract) throws java.io.IOException
java.io.IOException
public java.lang.String[] list() throws java.io.IOException
java.io.IOException
public void removeExtracted(java.io.File targetDir) throws java.io.IOException
targetDir
. If a file cannot be removed, log a warning and continue.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |