|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mmoui.manager.services.Extractor
public abstract class Extractor
Defines a class which can be used to extract an archive (such as a
ZIP or RAR archive). Extractor objects should be created
via an ExtractorFactoryService in most cases. This allows
modules to focus on the behavior required without need to reimplement
the various extraction capabilities for different types of archives.
| Constructor Summary | |
|---|---|
Extractor()
|
|
| Method Summary | |
|---|---|
void |
extract(java.io.File directory,
UpdateStatusListener listener)
Extracts all files in the archive into the specified directory, overwriting any conflicting files. |
java.io.File |
extract(UpdateStatusListener listener)
Extracts all files in the archive which is represented by this Extractor into a new temporary directory |
protected abstract void |
getEntry(java.io.File outputFile)
Extracts the current entry into the specified outputFile |
abstract java.lang.String[] |
getFileNames()
Gets a listing of all file and directory names found inside the archive. |
protected abstract java.lang.String |
getNextEntry()
Gets the next available entry in the archive, terminating extraction of the current entry if it exists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Extractor()
| Method Detail |
|---|
public abstract java.lang.String[] getFileNames()
throws java.io.IOException
java.io.IOException - if an error occurs while reading the archive
protected abstract java.lang.String getNextEntry()
throws java.io.IOException
extractEntry() can be supported.
java.io.IOException - if an error occurs while reading the archive
protected abstract void getEntry(java.io.File outputFile)
throws java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.IllegalStateException
outputFile - the file to which data should be extracted
java.io.IOException - if an I/O error occurs while extracting
the data from the archive
java.lang.IllegalArgumentException - if outputFile is not a file
java.lang.IllegalStateException - if the current entry is a directory or
there is no current entrygetNextEntry()
public java.io.File extract(UpdateStatusListener listener)
throws java.io.IOException
Extractor into a new temporary directory
listener - the UpdateStatusListener object which
can be used to update the extraction status
java.io.IOException - if an I/O or archive exception occurs
while extractingextract(java.io.File, com.mmoui.manager.services.UpdateStatusListener)
public void extract(java.io.File directory,
UpdateStatusListener listener)
throws java.io.IOException,
java.lang.IllegalArgumentException
directory - the directory to which contents should be
extractedlistener - the UpdateStatusListener object which
can be used to update the extraction status
java.io.IOException - if an I/O error occurs while extracting
java.lang.IllegalArgumentException - if the specified parameter
is not a directory
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||