Package org.apache.maven.index.util.zip
Class JavaZipFileHandle
- java.lang.Object
-
- org.apache.maven.index.util.zip.AbstractZipHandle
-
- org.apache.maven.index.util.zip.JavaZipFileHandle
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ZipHandle
public class JavaZipFileHandle extends AbstractZipHandle implements ZipHandle
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.zip.ZipFile
zipFile
-
Constructor Summary
Constructors Constructor Description JavaZipFileHandle(java.io.File targetFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the zip handle (performs resource cleanup).java.util.List<java.lang.String>
getEntries()
Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.java.util.List<java.lang.String>
getEntries(EntryNameFilter filter)
Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.java.io.InputStream
getEntryContent(java.lang.String path)
Returns the "payload" (uncompressed) of the entry at given path, or null if no such path exists in the Zip file this handle points to.protected java.util.zip.ZipFile
getZipFile()
boolean
hasEntry(java.lang.String path)
Returns true if Zip file this handle is pointing to contains an entry at given path.-
Methods inherited from class org.apache.maven.index.util.zip.AbstractZipHandle
getTargetFile
-
-
-
-
Method Detail
-
getZipFile
protected java.util.zip.ZipFile getZipFile()
-
hasEntry
public boolean hasEntry(java.lang.String path) throws java.io.IOException
Description copied from interface:ZipHandle
Returns true if Zip file this handle is pointing to contains an entry at given path.
-
getEntries
public java.util.List<java.lang.String> getEntries()
Description copied from interface:ZipHandle
Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.- Specified by:
getEntries
in interfaceZipHandle
- Returns:
-
getEntries
public java.util.List<java.lang.String> getEntries(EntryNameFilter filter)
Description copied from interface:ZipHandle
Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.- Specified by:
getEntries
in interfaceZipHandle
- Returns:
-
getEntryContent
public java.io.InputStream getEntryContent(java.lang.String path) throws java.io.IOException
Description copied from interface:ZipHandle
Returns the "payload" (uncompressed) of the entry at given path, or null if no such path exists in the Zip file this handle points to.- Specified by:
getEntryContent
in interfaceZipHandle
- Returns:
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Description copied from interface:ZipHandle
Closes the zip handle (performs resource cleanup). This method should be called when this zip handle is not needed anymore, and calling it should be obligatory to prevent resource leaks.
-
-