public class ResourceCollection extends Resource
__defaultUseCaches| Constructor and Description |
|---|
ResourceCollection()
Instantiates an empty resource collection.
|
ResourceCollection(Resource... resources)
Instantiates a new resource collection.
|
ResourceCollection(String csvResources)
Instantiates a new resource collection.
|
ResourceCollection(String[] resources)
Instantiates a new resource collection.
|
| Modifier and Type | Method and Description |
|---|---|
Resource |
addPath(String path)
Returns the resource contained inside the current resource with the
given name.
|
void |
copyTo(File destination) |
boolean |
delete()
Deletes the given resource
|
boolean |
exists()
Returns true if the respresened resource exists.
|
protected Object |
findResource(String path) |
File |
getFile()
Returns an File representing the given resource or NULL if this
is not possible.
|
InputStream |
getInputStream()
Returns an input stream to the resource
|
String |
getName()
Returns the name of the resource
|
OutputStream |
getOutputStream()
Returns an output stream to the resource
|
Resource[] |
getResources()
Retrieves the resource collection's resources.
|
URL |
getURL()
Returns an URL representing the given resource
|
boolean |
isContainedIn(Resource r) |
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
|
String[] |
list()
Returns a list of resource names contained in the given resource
The resource names are not URL encoded.
|
void |
release()
Release any temporary resources held by the resource.
|
boolean |
renameTo(Resource dest)
Rename the given resource
|
void |
setResources(Resource[] resources)
Sets the resource collection's resources.
|
void |
setResourcesAsCSV(String csvResources)
Sets the resources as string of comma-separated values.
|
String |
toString() |
encode, finalize, getAlias, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, getWeakETag, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newResource, newSystemResource, setAssociate, setDefaultUseCaches, toURL, writeTopublic ResourceCollection()
public ResourceCollection(Resource... resources)
resources - the resources to be added to collectionpublic ResourceCollection(String[] resources)
resources - the resource strings to be added to collectionpublic ResourceCollection(String csvResources)
csvResources - the string containing comma-separated resource stringspublic Resource[] getResources()
public void setResources(Resource[] resources)
resources - the new resource arraypublic void setResourcesAsCSV(String csvResources)
csvResources - the comma-separated string containing
one or more resource strings.public Resource addPath(String path) throws IOException, MalformedURLException
ResourceaddPath in class Resourcepath - The path segment to addIOExceptionMalformedURLExceptionprotected Object findResource(String path) throws IOException, MalformedURLException
path - IOExceptionMalformedURLExceptionpublic boolean delete()
throws SecurityException
Resourcedelete in class ResourceSecurityExceptionpublic boolean exists()
Resourcepublic File getFile() throws IOException
ResourcegetFile in class ResourceIOExceptionpublic InputStream getInputStream() throws IOException
ResourcegetInputStream in class ResourceIOExceptionpublic String getName()
Resourcepublic OutputStream getOutputStream() throws IOException, SecurityException
ResourcegetOutputStream in class ResourceIOExceptionSecurityExceptionpublic URL getURL()
Resourcepublic boolean isDirectory()
ResourceisDirectory in class Resourcepublic long lastModified()
ResourcelastModified in class Resourcepublic long length()
Resourcepublic String[] list()
Resourcepublic void release()
Resourcepublic boolean renameTo(Resource dest) throws SecurityException
ResourcerenameTo in class ResourceSecurityExceptionpublic void copyTo(File destination) throws IOException
copyTo in class ResourceIOExceptionpublic String toString()
public boolean isContainedIn(Resource r) throws MalformedURLException
isContainedIn in class ResourceMalformedURLExceptionCopyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.