Package org.apache.maven.index.util.zip
Interface ZipHandle
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Implementing Classes:
AbstractZipHandle,JavaZipFileHandle
public interface ZipHandle extends java.io.CloseableA very simplistic approach to hide the underlying mech to deal with ZipFiles, suited for use cases happening in Maven Indexer.
-
-
Method Summary
All Methods Instance Methods Abstract 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.booleanhasEntry(java.lang.String path)Returns true if Zip file this handle is pointing to contains an entry at given path.
-
-
-
Method Detail
-
hasEntry
boolean hasEntry(java.lang.String path) throws java.io.IOExceptionReturns true if Zip file this handle is pointing to contains an entry at given path.- Parameters:
path-- Returns:
- Throws:
java.io.IOException
-
getEntries
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.- Returns:
-
getEntries
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.- Returns:
-
getEntryContent
java.io.InputStream getEntryContent(java.lang.String path) throws java.io.IOExceptionReturns the "payload" (uncompressed) of the entry at given path, or null if no such path exists in the Zip file this handle points to.- Parameters:
path-- Returns:
- Throws:
java.io.IOException
-
close
void close() throws java.io.IOExceptionCloses 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.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-