|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.l2fprod.util.ZipResourceLoader
public class ZipResourceLoader
Loads files from a local or network zip archive.
Nested Class Summary | |
---|---|
class |
ZipResourceLoader.ZipResource
A class that represents a file contained in a zip archive. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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
Method Detail |
---|
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 arguments
java.lang.Exception
- If anything whatsoever goes wrong. :-)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |