org.apache.maven.index.util.zip
Interface ZipHandle

All Known Implementing Classes:
AbstractZipHandle, JavaZipFileHandle, TrueZipZipFileHandle

public interface ZipHandle

A very simplistic approach to hide the underlying mech to deal with ZipFiles, suited for use cases happening in Maven Indexer.

Author:
cstamas

Method Summary
 void close()
          Closes the zip handle (performs resource cleanup).
 List<String> getEntries()
          Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.
 List<String> getEntries(EntryNameFilter filter)
          Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.
 InputStream getEntryContent(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.
 boolean hasEntry(String path)
          Returns true if Zip file this handle is pointing to contains an entry at given path.
 

Method Detail

hasEntry

boolean hasEntry(String path)
                 throws IOException
Returns true if Zip file this handle is pointing to contains an entry at given path.

Parameters:
path -
Returns:
Throws:
IOException

getEntries

List<String> getEntries()
Returns a list of string, with each string representing a valid path for existing entry in this Zip handle.

Returns:

getEntries

List<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

InputStream getEntryContent(String path)
                            throws IOException
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.

Parameters:
path -
Returns:
Throws:
IOException

close

void close()
           throws IOException
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.

Throws:
IOException


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.