Class Expander
- java.lang.Object
-
- org.apache.commons.compress.archivers.examples.Expander
-
public class Expander extends java.lang.Object
Provides a high level API for expanding archives.- Since:
- 1.17
-
-
Constructor Summary
Constructors Constructor Description Expander()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexpand(java.io.File archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(java.io.InputStream archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(java.lang.String format, java.io.File archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(java.lang.String format, java.io.InputStream archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(java.lang.String format, java.nio.channels.SeekableByteChannel archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(ArchiveInputStream archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(SevenZFile archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.voidexpand(ZipFile archive, java.io.File targetDirectory)ExpandsarchiveintotargetDirectory.
-
-
-
Constructor Detail
-
Expander
public Expander()
-
-
Method Detail
-
expand
public void expand(java.io.File archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.Tries to auto-detect the archive's format.
- Parameters:
archive- the file to expandtargetDirectory- the directory to write to- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(java.lang.String format, java.io.File archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.- Parameters:
archive- the file to expandtargetDirectory- the directory to write toformat- the archive format. This uses the same format as accepted byArchiveStreamFactory.- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(java.io.InputStream archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.Tries to auto-detect the archive's format.
- Parameters:
archive- the file to expandtargetDirectory- the directory to write to- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(java.lang.String format, java.io.InputStream archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.- Parameters:
archive- the file to expandtargetDirectory- the directory to write toformat- the archive format. This uses the same format as accepted byArchiveStreamFactory.- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(java.lang.String format, java.nio.channels.SeekableByteChannel archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.- Parameters:
archive- the file to expandtargetDirectory- the directory to write toformat- the archive format. This uses the same format as accepted byArchiveStreamFactory.- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(ArchiveInputStream archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.- Parameters:
archive- the file to expandtargetDirectory- the directory to write to- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(ZipFile archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.- Parameters:
archive- the file to expandtargetDirectory- the directory to write to- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
expand
public void expand(SevenZFile archive, java.io.File targetDirectory) throws java.io.IOException, ArchiveException
ExpandsarchiveintotargetDirectory.- Parameters:
archive- the file to expandtargetDirectory- the directory to write to- Throws:
java.io.IOException- if an I/O error occursArchiveException- if the archive cannot be read for other reasons
-
-