public class ResourceCollection extends Resource
__defaultUseCaches| Constructor and Description |
|---|
ResourceCollection()
Instantiates an empty resource collection.
|
ResourceCollection(Resource... resources)
Instantiates a new resource collection.
|
ResourceCollection(java.lang.String csvResources)
Instantiates a new resource collection.
|
ResourceCollection(java.lang.String[] resources)
Instantiates a new resource collection.
|
| Modifier and Type | Method and Description |
|---|---|
Resource |
addPath(java.lang.String path)
Returns the resource contained inside the current resource with the
given name.
|
void |
copyTo(java.io.File destination) |
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()
Retrieves the resource collection's resources.
|
java.net.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
|
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 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(java.lang.String csvResources)
Sets the resources as string of comma-separated values.
|
java.lang.String |
toString() |
encode, finalize, getAlias, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, 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(java.lang.String[] resources)
resources - the resource strings to be added to collectionpublic ResourceCollection(java.lang.String csvResources)
csvResources - the string containing comma-separated resource stringspublic Resource[] getResources()
public void setResources(Resource[] resources)
resources - the new resource arraypublic void setResourcesAsCSV(java.lang.String csvResources)
csvResources - the comma-separated string containing
one or more resource strings.public Resource addPath(java.lang.String path) throws java.io.IOException, java.net.MalformedURLException
Resourceprotected java.lang.Object findResource(java.lang.String path)
throws java.io.IOException,
java.net.MalformedURLException
path - java.io.IOExceptionjava.net.MalformedURLExceptionpublic boolean delete()
throws java.lang.SecurityException
Resourcepublic boolean exists()
Resourcepublic java.io.File getFile()
throws java.io.IOException
Resourcepublic java.io.InputStream getInputStream()
throws java.io.IOException
ResourcegetInputStream in class Resourcejava.io.IOExceptionpublic java.lang.String getName()
Resourcepublic java.io.OutputStream getOutputStream()
throws java.io.IOException,
java.lang.SecurityException
ResourcegetOutputStream in class Resourcejava.io.IOExceptionjava.lang.SecurityExceptionpublic java.net.URL getURL()
Resourcepublic boolean isDirectory()
ResourceisDirectory in class Resourcepublic long lastModified()
ResourcelastModified in class Resourcepublic long length()
Resourcepublic java.lang.String[] list()
Resourcepublic void release()
Resourcepublic boolean renameTo(Resource dest) throws java.lang.SecurityException
Resourcepublic void copyTo(java.io.File destination)
throws java.io.IOException
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isContainedIn(Resource r) throws java.net.MalformedURLException
isContainedIn in class Resourcejava.net.MalformedURLExceptionCopyright © 2013 FuseSource, Corp.. All Rights Reserved.