public class ZipResourceLoader
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ZipResourceLoader.ZipResource
A class that represents a file contained in a zip archive.
|
Constructor and Description |
---|
ZipResourceLoader(java.io.InputStream p_JarStream)
Creates a ZipResourceLoader that loads data from an InputStream.
|
ZipResourceLoader(java.net.URL p_JarUrl)
Creates a ZipResourceLoader that loads data from an URL.
|
Modifier and Type | Method and Description |
---|---|
void |
dump()
A debugging method.
|
java.util.Enumeration |
entries()
Gets the files contained in this zip archive.
|
java.net.URL |
getResource(java.lang.String name)
Gets the URL of a file in the archive.
|
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Opens an InputStream from a file contained in the archive.
|
ZipResourceLoader.ZipResource |
getZipResource(java.lang.String name)
Gets a ZipResource representing the file.
|
ZipResourceLoader.ZipResource |
getZipResource(java.net.URL name)
Gets a ZipResource representing the file.
|
static void |
main(java.lang.String[] args)
Diagnostic for the ZipResource class.
|
void |
release()
Releases the resources claimed by this object.
|
public ZipResourceLoader(java.net.URL p_JarUrl) throws java.io.IOException
p_JarUrl
- URL to load files from.java.io.IOException
- if there is an exception while loading the archive.public ZipResourceLoader(java.io.InputStream p_JarStream) throws java.io.IOException
java.io.IOException
public java.io.InputStream getResourceAsStream(java.lang.String name)
name
- Name of the file to retrieve.public java.net.URL getResource(java.lang.String name) throws java.net.MalformedURLException
name
- Name of the file to retrieve.java.net.MalformedURLException
- If the URL is malformed.public ZipResourceLoader.ZipResource getZipResource(java.lang.String name)
name
- The name of the file to retrieve.public ZipResourceLoader.ZipResource getZipResource(java.net.URL name)
name
- The URL of the resource to retrieve.public java.util.Enumeration entries()
public void dump()
public void release()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- The command line argumentsjava.lang.Exception
- If anything whatsoever goes wrong. :-)