|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectconsciouscode.util.resource.ZipResourceTree
public class ZipResourceTree
A ResourceTree
that reads resources from a ZIP archive.
ZipFile
Constructor Summary | |
---|---|
ZipResourceTree(File zipFile)
|
|
ZipResourceTree(File zipFile,
ResourceTreeProvider provider)
|
Method Summary | |
---|---|
protected String |
ensureRelativePath(String path)
|
protected ZipEntry |
getEntry(String path)
|
Resource |
getResource(String path)
Returns information about a resource file. |
ResourceTreeProvider |
getResourceTreeProvider()
Gets the provider of this resource tree. |
URL |
getResourceUrl(String path)
Returns a URL to a resource file. |
ZipFile |
getZipFile()
|
String |
toString()
|
URL |
toUrl(String path)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ZipResourceTree(File zipFile) throws IOException
zipFile
- must be a readable file in ZIP format.
IOException
- if there's a problem opening the archive.public ZipResourceTree(File zipFile, ResourceTreeProvider provider) throws IOException
zipFile
- must be a readable file in ZIP format.
IOException
- if there's a problem opening the archive.Method Detail |
---|
public ZipFile getZipFile()
public URL getResourceUrl(String path)
ResourceTree
getResourceUrl
in interface ResourceTree
null
if no resource exists at the given path.public Resource getResource(String path)
ResourceTree
getResource
in interface ResourceTree
path
- identifies the desired resource.
null
if no resource exists at the given path.public ResourceTreeProvider getResourceTreeProvider()
ResourceTree
getResourceTreeProvider
in interface ResourceTree
null
.public String toString()
toString
in class Object
protected String ensureRelativePath(String path)
protected ZipEntry getEntry(String path)
path
- can be either absolute or relative.public URL toUrl(String path)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |