|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.compress.PackableObject
org.apache.commons.compress.AbstractArchive
public abstract class AbstractArchive
Abstract implementation of an archiver
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.compress.PackableObject |
|---|
CHOOSE_EXTENSION, CHOOSE_NAME |
| Constructor Summary | |
|---|---|
AbstractArchive()
|
|
| Method Summary | |
|---|---|
void |
add(ArchiveEntry archiveEntry)
Adds a FileInputStream to the internal filelist for a possible pack-operation |
void |
add(File file)
Adds a file to the internal filelist for a possible pack-operation |
void |
close()
Closes this archiver and all internal streams. |
protected abstract void |
doSave(OutputStream output)
Specific implementation of the save opteration. |
protected abstract void |
doUnpack(File unpackDir)
Specific implementation of the unpack opteration. |
File |
getArchive()
Returns the archive file and null, if this archiver has not been saved yet or there has not been set an archive manually. |
Iterator |
getEntryIterator()
Get an iterator of ArchiveEntrys which shall be archived |
void |
save(File output)
Compresses the file with the given String as a filename |
void |
save(OutputStream output)
Packs a file. |
void |
setArchive(File file)
Sets an Archive for manipulating. |
void |
unpack(File unpackDir)
Unpacks to the specified directory |
| Methods inherited from class org.apache.commons.compress.PackableObject |
|---|
getDefaultFileExtension, getHeader, getName, identifyByHeader, isPackableWith |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractArchive()
| Method Detail |
|---|
public void save(File output)
throws ArchiveException
save in interface ArchiveArchiveException - if there is no destination file or files to be packedArchive.save(OutputStream)
public void save(OutputStream output)
throws ArchiveException
Archive
save in interface ArchiveArchiveException - if there is no destination file or files to be packed
protected abstract void doSave(OutputStream output)
throws ArchiveException
output - - stream to archive to
ArchiveExceptionpublic File getArchive()
Archive
getArchive in interface Archivepublic void setArchive(File file)
Archive
setArchive in interface Archivefile - the file to manipulate
public void add(File file)
throws FileNotFoundException
Archive
add in interface ArchiveFileNotFoundExceptionpublic void add(ArchiveEntry archiveEntry)
Archive
add in interface Archivepublic Iterator getEntryIterator()
Archive
getEntryIterator in interface Archive
public void unpack(File unpackDir)
throws UnpackException
Archive
unpack in interface ArchiveunpackDir - to unpack
UnpackException - if an unpack error occurs
protected abstract void doUnpack(File unpackDir)
throws UnpackException
unpackDir - dir, to unpack to
UnpackException
public void close()
throws IOException
Archive
close in interface ArchiveIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||