Closeable
, AutoCloseable
public class ZipFileInputStreamImpl extends BufferedInputStream
InputStream
from a provided File
: In case the
file points to a ZIP compressed file, then the uncompressed data of the
therein contained file with the same name excluding the ".zip" extension is
provided by the InputStream
.in
Constructor | Description |
---|---|
ZipFileInputStreamImpl(File aFile) |
Instantiates a new zip file input stream impl.
|
ZipFileInputStreamImpl(File parent,
String child) |
Instantiates a new zip file input stream impl.
|
ZipFileInputStreamImpl(String pathname) |
Instantiates a new zip file input stream impl.
|
ZipFileInputStreamImpl(String parent,
String child) |
Instantiates a new zip file input stream impl.
|
ZipFileInputStreamImpl(URI uri) |
Instantiates a new zip file input stream impl.
|
Modifier and Type | Method | Description |
---|---|---|
protected static String |
toFileNameFromZip(String aZipFileName) |
Truncates the ".zip" suffix from the filename and returns the result.
|
protected static InputStream |
toInputStream(File aFile) |
Returns an
InputStream from the provided File . |
available, close, mark, markSupported, read, read, reset, skip
read
readAllBytes, readNBytes, transferTo
public ZipFileInputStreamImpl(File parent, String child) throws ZipException, FileNotFoundException, IOException
parent
- the parentchild
- the childZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileInputStreamImpl(String parent, String child) throws ZipException, FileNotFoundException, IOException
parent
- the parentchild
- the childZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileInputStreamImpl(String pathname) throws ZipException, FileNotFoundException, IOException
pathname
- the pathnameZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileInputStreamImpl(URI uri) throws ZipException, FileNotFoundException, IOException
uri
- the uriZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.public ZipFileInputStreamImpl(File aFile) throws ZipException, FileNotFoundException, IOException
aFile
- the fileZipException
- the zip exceptionFileNotFoundException
- the file not found exceptionIOException
- Signals that an I/O exception has occurred.protected static InputStream toInputStream(File aFile) throws ZipException, IOException, FileNotFoundException
InputStream
from the provided File
. In case
the file points to a ZIP compressed file, then the uncompressed data is
provided by the InputStream
.aFile
- The File
for which to get the InputStream
.InputStream
, in case of a ZIP compressed File
,
an uncompressed InputStream
is returned.ZipException
- in case there were problems when accessing the ZIP
compressed File
.IOException
- in case there were problems working with the
File
.FileNotFoundException
- in case there was none such File
found.protected static String toFileNameFromZip(String aZipFileName)
aZipFileName
- The file name of the ZIP file for which to get the
"inner" file name.Copyright © 2018. All rights reserved.