Class Expander
- Since:
- 1.17
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interface
private static interface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Expandsarchive
intotargetDirectory
.void
expand
(InputStream archive, File targetDirectory) Deprecated.this method leaks resourcesvoid
expand
(InputStream archive, File targetDirectory, CloseableConsumer closeableConsumer) Expandsarchive
intotargetDirectory
.void
Expandsarchive
intotargetDirectory
.void
expand
(String format, InputStream archive, File targetDirectory) Deprecated.this method leaks resourcesvoid
expand
(String format, InputStream archive, File targetDirectory, CloseableConsumer closeableConsumer) Expandsarchive
intotargetDirectory
.void
expand
(String format, SeekableByteChannel archive, File targetDirectory) Deprecated.this method leaks resourcesvoid
expand
(String format, SeekableByteChannel archive, File targetDirectory, CloseableConsumer closeableConsumer) Expandsarchive
intotargetDirectory
.void
expand
(ArchiveInputStream archive, File targetDirectory) Expandsarchive
intotargetDirectory
.private void
expand
(Expander.ArchiveEntrySupplier supplier, Expander.EntryWriter writer, File targetDirectory) void
expand
(SevenZFile archive, File targetDirectory) Expandsarchive
intotargetDirectory
.void
Expandsarchive
intotargetDirectory
.void
Expandsarchive
intotargetDirectory
.private boolean
prefersSeekableByteChannel
(String format)
-
Constructor Details
-
Expander
public Expander()
-
-
Method Details
-
expand
Expandsarchive
intotargetDirectory
.Tries to auto-detect the archive's format.
- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write to- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
public void expand(String format, File archive, File targetDirectory) throws IOException, ArchiveException Expandsarchive
intotargetDirectory
.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as accepted byArchiveStreamFactory
.- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
@Deprecated public void expand(InputStream archive, File targetDirectory) throws IOException, ArchiveException Deprecated.this method leaks resourcesExpandsarchive
intotargetDirectory
.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.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write to- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
public void expand(InputStream archive, File targetDirectory, CloseableConsumer closeableConsumer) throws IOException, ArchiveException Expandsarchive
intotargetDirectory
.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.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write tocloseableConsumer
- is informed about the stream wrapped around the passed in stream- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons- Since:
- 1.19
-
expand
@Deprecated public void expand(String format, InputStream archive, File targetDirectory) throws IOException, ArchiveException Deprecated.this method leaks resourcesExpandsarchive
intotargetDirectory
.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.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as accepted byArchiveStreamFactory
.- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
public void expand(String format, InputStream archive, File targetDirectory, CloseableConsumer closeableConsumer) throws IOException, ArchiveException Expandsarchive
intotargetDirectory
.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.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as accepted byArchiveStreamFactory
.closeableConsumer
- is informed about the stream wrapped around the passed in stream- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons- Since:
- 1.19
-
expand
@Deprecated public void expand(String format, SeekableByteChannel archive, File targetDirectory) throws IOException, ArchiveException Deprecated.this method leaks resourcesExpandsarchive
intotargetDirectory
.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.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as accepted byArchiveStreamFactory
.- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
public void expand(String format, SeekableByteChannel archive, File targetDirectory, CloseableConsumer closeableConsumer) throws IOException, ArchiveException Expandsarchive
intotargetDirectory
.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.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write toformat
- the archive format. This uses the same format as accepted byArchiveStreamFactory
.closeableConsumer
- is informed about the stream wrapped around the passed in channel- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons- Since:
- 1.19
-
expand
public void expand(ArchiveInputStream archive, File targetDirectory) throws IOException, ArchiveException Expandsarchive
intotargetDirectory
.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write to- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
Expandsarchive
intotargetDirectory
.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write to- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons- Since:
- 1.21
-
expand
Expandsarchive
intotargetDirectory
.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write to- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
expand
Expandsarchive
intotargetDirectory
.- Parameters:
archive
- the file to expandtargetDirectory
- the directory to write to- Throws:
IOException
- if an I/O error occursArchiveException
- if the archive cannot be read for other reasons
-
prefersSeekableByteChannel
-
expand
private void expand(Expander.ArchiveEntrySupplier supplier, Expander.EntryWriter writer, File targetDirectory) throws IOException - Throws:
IOException
-