public class SimpleWritingFileHandler extends Object implements FileHandler
FileHandler which extracts all files to a given directory
(including the subdirectories defined in the archive).| Modifier and Type | Field and Description |
|---|---|
protected String |
rootDir
The directory to which all files will be extracted.
|
| Constructor and Description |
|---|
SimpleWritingFileHandler(String rootDir)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
handleStream(InputStream in,
String name,
long size)
This method is called for processing a single file within a tar file.
|
protected String rootDir
public SimpleWritingFileHandler(String rootDir)
rootDir - the directory to which all files will be extractedpublic void handleStream(InputStream in, String name, long size) throws IOException
FileHandlerhandleStream in interface FileHandlerin - the input stream, from which the content of the file can be readname - the name of the file within the tar archivesize - the size of the file (in bytes). At the same time, this is the
maximum number of bytes the method is allowed to read from the
given streamIOException - if an IO error occurs when reading from the given streamCopyright © 2019–2020. All rights reserved.