Package org.apache.felix.framework.util
Class WeakZipFileFactory.WeakZipFile
- java.lang.Object
-
- org.apache.felix.framework.util.WeakZipFileFactory.WeakZipFile
-
- Enclosing class:
- WeakZipFileFactory
public class WeakZipFileFactory.WeakZipFile extends java.lang.Object
This class wraps a ZipFile to making it possible to weakly close it; this means the underlying zip file will be automatically reopened on demand if anyone tries to use it.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This method permanently closes the zip file.java.util.Enumeration<java.util.zip.ZipEntry>
entries()
Returns an enumeration of zip entries from the zip file.java.util.zip.ZipEntry
getEntry(java.lang.String name)
Returns the specified entry from the zip file.java.io.InputStream
getInputStream(java.util.zip.ZipEntry ze)
Returns an input stream for the specified zip entry.
-
-
-
Method Detail
-
getEntry
public java.util.zip.ZipEntry getEntry(java.lang.String name)
Returns the specified entry from the zip file.- Parameters:
name
- the name of the entry to return.- Returns:
- the zip entry associated with the specified name or null if it does not exist.
-
entries
public java.util.Enumeration<java.util.zip.ZipEntry> entries()
Returns an enumeration of zip entries from the zip file.- Returns:
- an enumeration of zip entries.
-
getInputStream
public java.io.InputStream getInputStream(java.util.zip.ZipEntry ze) throws java.io.IOException
Returns an input stream for the specified zip entry.- Parameters:
ze
- the zip entry whose input stream is to be retrieved.- Returns:
- an input stream to the zip entry.
- Throws:
java.io.IOException
- if the input stream cannot be opened.
-
close
public void close() throws java.io.IOException
This method permanently closes the zip file.- Throws:
java.io.IOException
- if any error occurs while trying to close the zip file.
-
-