|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.util.resource.Resource
org.eclipse.jetty.util.resource.ResourceCollection
public class ResourceCollection
A collection of resources (dirs). Allows webapps to have multiple (static) sources. The first resource in the collection is the main resource. If a resource is not found in the main resource, it looks it up in the order the resources were constructed.
| Field Summary |
|---|
| Fields inherited from class org.eclipse.jetty.util.resource.Resource |
|---|
__defaultUseCaches |
| Constructor Summary | |
|---|---|
ResourceCollection(Resource... resources)
|
|
ResourceCollection(java.lang.String csvResources)
|
|
ResourceCollection(java.lang.String[] resources)
|
|
| Method Summary | |
|---|---|
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()
|
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 |
java.lang.String |
toString()
|
| Methods inherited from class org.eclipse.jetty.util.resource.Resource |
|---|
encode, finalize, getAlias, getAssociate, getDefaultUseCaches, getListHTML, getResource, getURI, isContainedIn, newClassPathResource, newClassPathResource, newResource, newResource, newResource, newResource, newSystemResource, setAssociate, setDefaultUseCaches, writeTo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceCollection(Resource... resources)
public ResourceCollection(java.lang.String[] resources)
public ResourceCollection(java.lang.String csvResources)
| Method Detail |
|---|
public Resource[] getResources()
public Resource addPath(java.lang.String path)
throws java.io.IOException,
java.net.MalformedURLException
Resource
addPath in class Resourcepath - The path segment to add
java.io.IOException
java.net.MalformedURLException
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
delete in class Resourcejava.lang.SecurityExceptionpublic boolean exists()
Resource
exists in class Resource
public java.io.File getFile()
throws java.io.IOException
Resource
getFile in class Resourcejava.io.IOException
public java.io.InputStream getInputStream()
throws java.io.IOException
Resource
getInputStream in class Resourcejava.io.IOExceptionpublic java.lang.String getName()
Resource
getName in class Resource
public java.io.OutputStream getOutputStream()
throws java.io.IOException,
java.lang.SecurityException
Resource
getOutputStream in class Resourcejava.io.IOException
java.lang.SecurityExceptionpublic java.net.URL getURL()
Resource
getURL in class Resourcepublic boolean isDirectory()
Resource
isDirectory in class Resourcepublic long lastModified()
Resource
lastModified in class Resourcepublic long length()
Resource
length in class Resourcepublic java.lang.String[] list()
Resource
list in class Resourcepublic void release()
Resource
release in class Resource
public boolean renameTo(Resource dest)
throws java.lang.SecurityException
Resource
renameTo in class Resourcejava.lang.SecurityException
public void copyTo(java.io.File destination)
throws java.io.IOException
copyTo in class Resourcejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
public boolean isContainedIn(Resource r)
throws java.net.MalformedURLException
isContainedIn in class Resourcejava.net.MalformedURLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||