public class ResourceCollection extends Resource
__defaultUseCaches
Constructor and Description |
---|
ResourceCollection() |
ResourceCollection(Resource[] resources) |
ResourceCollection(java.lang.String csvResources) |
ResourceCollection(java.lang.String[] resources) |
Modifier and Type | Method and Description |
---|---|
Resource |
addPath(java.lang.String path)
Returns the resource contained inside the current resource with the
given name.
|
boolean |
delete()
Deletes the given resource
|
boolean |
exists()
Returns true if the respresened resource exists.
|
protected java.lang.Object |
findResource(java.lang.String path) |
java.io.File |
getFile()
Returns an File representing the given resource or NULL if this
is not possible.
|
java.io.InputStream |
getInputStream()
Returns an input stream to the resource
|
java.lang.String |
getName()
Returns the name of the resource
|
java.io.OutputStream |
getOutputStream()
Returns an output stream to the resource
|
Resource[] |
getResources() |
java.net.URL |
getURL()
Returns an URL representing the given resource
|
boolean |
isDirectory()
Returns true if the respresenetd resource is a container/directory.
|
long |
lastModified()
Returns the last modified time
|
long |
length()
Return the length of the resource
|
java.lang.String[] |
list()
Returns a list of resource names contained in the given resource
The resource names are not URL encoded.
|
void |
release()
Release any resources held by the resource.
|
boolean |
renameTo(Resource dest)
Rename the given resource
|
void |
setResources(Resource[] resources) |
void |
setResources(java.lang.String csvResources) |
void |
setResources(java.lang.String[] resources) |
void |
setResourcesAsCSV(java.lang.String csvResources) |
java.lang.String |
toString() |
encode, finalize, getAlias, getAssociate, getDefaultUseCaches, getListHTML, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newSystemResource, setAssociate, setDefaultUseCaches, writeTo
public ResourceCollection()
public ResourceCollection(Resource[] resources)
public ResourceCollection(java.lang.String[] resources)
public ResourceCollection(java.lang.String csvResources)
public void setResources(Resource[] resources)
resources
- Resource arraypublic void setResources(java.lang.String[] resources)
resources
- String arraypublic void setResources(java.lang.String csvResources)
csvResources
- Comma separated valuespublic void setResourcesAsCSV(java.lang.String csvResources)
csvResources
- Comma separated valuespublic Resource[] getResources()
public Resource addPath(java.lang.String path) throws java.io.IOException, java.net.MalformedURLException
Resource
protected java.lang.Object findResource(java.lang.String path) throws java.io.IOException, java.net.MalformedURLException
path
- java.io.IOException
java.net.MalformedURLException
public boolean delete() throws java.lang.SecurityException
Resource
public boolean exists()
Resource
public java.io.File getFile() throws java.io.IOException
Resource
public java.io.InputStream getInputStream() throws java.io.IOException
Resource
getInputStream
in class Resource
java.io.IOException
public java.lang.String getName()
Resource
public java.io.OutputStream getOutputStream() throws java.io.IOException, java.lang.SecurityException
Resource
getOutputStream
in class Resource
java.io.IOException
java.lang.SecurityException
public java.net.URL getURL()
Resource
public boolean isDirectory()
Resource
isDirectory
in class Resource
public long lastModified()
Resource
lastModified
in class Resource
public long length()
Resource
public java.lang.String[] list()
Resource
public void release()
Resource
public boolean renameTo(Resource dest) throws java.lang.SecurityException
Resource
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.