public class

URLJarFile

extends JarFile
java.lang.Object
   ↳ java.util.zip.ZipFile
     ↳ java.util.jar.JarFile
       ↳ sun.net.www.protocol.jar.URLJarFile

Summary

Nested Classes
interface URLJarFile.URLJarFileCloseController  
[Expand]
Inherited Constants
From class java.util.jar.JarFile
From class java.util.zip.ZipFile
Public Constructors
URLJarFile(File file)
URLJarFile(File file, URLJarFile.URLJarFileCloseController closeController)
Public Methods
void close()
Closes the ZIP file.
ZipEntry getEntry(String name)
Returns the ZipEntry for the given entry name or null if not found.
Manifest getManifest()
Returns the jar file manifest, or null if none.
static void setCallBack(URLJarFileCallBack cb)
Protected Methods
void finalize()
Ensures that the close method of this ZIP file is called when there are no more references to it.
[Expand]
Inherited Methods
From class java.util.jar.JarFile
From class java.util.zip.ZipFile
From class java.lang.Object

Public Constructors

public URLJarFile (File file)

Throws
IOException

public URLJarFile (File file, URLJarFile.URLJarFileCloseController closeController)

Throws
IOException

Public Methods

public void close ()

Closes the ZIP file.

Closing this ZIP file will close all of the input streams previously returned by invocations of the getInputStream method.

Throws
IOException

public ZipEntry getEntry (String name)

Returns the ZipEntry for the given entry name or null if not found.

Parameters
name the JAR file entry name
Returns
  • the ZipEntry for the given entry name or null if not found
See Also

public Manifest getManifest ()

Returns the jar file manifest, or null if none.

Returns
  • the jar file manifest, or null if none
Throws
IOException

public static void setCallBack (URLJarFileCallBack cb)

Protected Methods

protected void finalize ()

Ensures that the close method of this ZIP file is called when there are no more references to it.

Since the time when GC would invoke this method is undetermined, it is strongly recommended that applications invoke the close method as soon they have finished accessing this ZipFile. This will prevent holding up system resources for an undetermined length of time.

Throws
IOException