Constructor and Description |
---|
Expander() |
Modifier and Type | Method and Description |
---|---|
void |
expand(ArchiveInputStream archive,
File targetDirectory)
Expands
archive into targetDirectory . |
void |
expand(File archive,
File targetDirectory)
Expands
archive into targetDirectory . |
void |
expand(InputStream archive,
File targetDirectory)
Deprecated.
this method leaks resources
|
void |
expand(InputStream archive,
File targetDirectory,
CloseableConsumer closeableConsumer)
Expands
archive into targetDirectory . |
void |
expand(SevenZFile archive,
File targetDirectory)
Expands
archive into targetDirectory . |
void |
expand(String format,
File archive,
File targetDirectory)
Expands
archive into targetDirectory . |
void |
expand(String format,
InputStream archive,
File targetDirectory)
Deprecated.
this method leaks resources
|
void |
expand(String format,
InputStream archive,
File targetDirectory,
CloseableConsumer closeableConsumer)
Expands
archive into targetDirectory . |
void |
expand(String format,
SeekableByteChannel archive,
File targetDirectory)
Deprecated.
this method leaks resources
|
void |
expand(String format,
SeekableByteChannel archive,
File targetDirectory,
CloseableConsumer closeableConsumer)
Expands
archive into targetDirectory . |
void |
expand(ZipFile archive,
File targetDirectory)
Expands
archive into targetDirectory . |
public Expander()
public void expand(File archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.
Tries to auto-detect the archive's format.
archive
- the file to expandtargetDirectory
- the directory to write toIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(String format, File archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as
accepted by ArchiveStreamFactory
.IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons@Deprecated public void expand(InputStream archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.
Tries to auto-detect the archive's format.
This method creates a wrapper around the archive stream
which is never closed and thus leaks resources, please use
expand(InputStream,File,CloseableConsumer)
instead.
archive
- the file to expandtargetDirectory
- the directory to write toIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(InputStream archive, File targetDirectory, CloseableConsumer closeableConsumer) throws IOException, ArchiveException
archive
into targetDirectory
.
Tries to auto-detect the archive's format.
This method creates a wrapper around the archive stream and
the caller of this method is responsible for closing it -
probably at the same time as closing the stream itself. The
caller is informed about the wrapper object via the closeableConsumer
callback as soon as it is no longer needed
by this class.
archive
- the file to expandtargetDirectory
- the directory to write tocloseableConsumer
- is informed about the stream wrapped around the passed in streamIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons@Deprecated public void expand(String format, InputStream archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.
This method creates a wrapper around the archive stream
which is never closed and thus leaks resources, please use
expand(String,InputStream,File,CloseableConsumer)
instead.
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as
accepted by ArchiveStreamFactory
.IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(String format, InputStream archive, File targetDirectory, CloseableConsumer closeableConsumer) throws IOException, ArchiveException
archive
into targetDirectory
.
This method creates a wrapper around the archive stream and
the caller of this method is responsible for closing it -
probably at the same time as closing the stream itself. The
caller is informed about the wrapper object via the closeableConsumer
callback as soon as it is no longer needed
by this class.
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as
accepted by ArchiveStreamFactory
.closeableConsumer
- is informed about the stream wrapped around the passed in streamIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons@Deprecated public void expand(String format, SeekableByteChannel archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.
This method creates a wrapper around the archive channel
which is never closed and thus leaks resources, please use
expand(String,SeekableByteChannel,File,CloseableConsumer)
instead.
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as
accepted by ArchiveStreamFactory
.IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(String format, SeekableByteChannel archive, File targetDirectory, CloseableConsumer closeableConsumer) throws IOException, ArchiveException
archive
into targetDirectory
.
This method creates a wrapper around the archive channel and
the caller of this method is responsible for closing it -
probably at the same time as closing the channel itself. The
caller is informed about the wrapper object via the closeableConsumer
callback as soon as it is no longer needed
by this class.
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as
accepted by ArchiveStreamFactory
.closeableConsumer
- is informed about the stream wrapped around the passed in channelIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(ArchiveInputStream archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.archive
- the file to expandtargetDirectory
- the directory to write toIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(ZipFile archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.archive
- the file to expandtargetDirectory
- the directory to write toIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonspublic void expand(SevenZFile archive, File targetDirectory) throws IOException, ArchiveException
archive
into targetDirectory
.archive
- the file to expandtargetDirectory
- the directory to write toIOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasonsCopyright © 2020 The Apache Software Foundation. All rights reserved.