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.ZipFilezipFile
-
Constructor Summary
Constructors Constructor Description JavaZipFileHandle(java.io.File targetFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.InputStreamgetEntryContent(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.ZipFilegetZipFile()booleanhasEntry(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.IOExceptionDescription copied from interface:ZipHandleReturns 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:ZipHandleReturns a list of string, with each string representing a valid path for existing entry in this Zip handle.- Specified by:
getEntriesin interfaceZipHandle- Returns:
-
getEntries
public java.util.List<java.lang.String> getEntries(EntryNameFilter filter)
Description copied from interface:ZipHandleReturns a list of string, with each string representing a valid path for existing entry in this Zip handle.- Specified by:
getEntriesin interfaceZipHandle- Returns:
-
getEntryContent
public java.io.InputStream getEntryContent(java.lang.String path) throws java.io.IOExceptionDescription copied from interface:ZipHandleReturns 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:
getEntryContentin interfaceZipHandle- Returns:
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:ZipHandleCloses 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.
-
-