Package org.openpreservation.format.zip
Class ZipFileProcessor
java.lang.Object
org.openpreservation.format.zip.ZipFileProcessor
- All Implemented Interfaces:
ZipArchive
,ZipArchiveCache
An implementation of
ZipArchiveCache
that caches the contents of the
archive and provides access to the InputStream
s.-
Method Summary
Modifier and TypeMethodDescriptionGet aList
of all of the cached entries in the archivegetEntryInputStream
(String entryName) Get theInputStream
for the entry with the passed name, equivalent to the path.Returns the first physicalZipEntry
in the archive.getPath()
Get the path to the archiveGet aList
of all of the zip entries in the archivegetZipEntry
(String entryName) Retrieve aZipEntry
by entry name, equivalent to the path.int
size()
Get the count of entries in the archive
-
Method Details
-
getPath
Description copied from interface:ZipArchive
Get the path to the archive- Specified by:
getPath
in interfaceZipArchive
- Returns:
- the
Path
to the archive
-
getZipEntries
Description copied from interface:ZipArchive
Get aList
of all of the zip entries in the archive- Specified by:
getZipEntries
in interfaceZipArchive
- Returns:
- an ordered
List
of all of the zip entries in the archive
-
getFirstEntry
Returns the first physicalZipEntry
in the archive.- Specified by:
getFirstEntry
in interfaceZipArchive
- Returns:
- the first physical
ZipEntry
in the archive
-
getZipEntry
Description copied from interface:ZipArchive
Retrieve aZipEntry
by entry name, equivalent to the path.- Specified by:
getZipEntry
in interfaceZipArchive
- Parameters:
entryName
- the name of theZipEntry
to retrieve- Returns:
- the
ZipEntry
with the givenentryName
, ornull
if no match
-
size
public int size()Description copied from interface:ZipArchive
Get the count of entries in the archive- Specified by:
size
in interfaceZipArchive
- Returns:
int
number ofZipEntries
in the archive
-
getCachedEntryNames
Description copied from interface:ZipArchiveCache
Get aList
of all of the cached entries in the archive- Specified by:
getCachedEntryNames
in interfaceZipArchiveCache
- Returns:
-
getEntryInputStream
Description copied from interface:ZipArchiveCache
Get theInputStream
for the entry with the passed name, equivalent to the path.- Specified by:
getEntryInputStream
in interfaceZipArchiveCache
- Returns:
- the
InputStream
for the entry with the passedname
, ornull
if no match - Throws:
IOException
-