public class ClassPathResource extends Resource
| Constructor and Description |
|---|
ClassPathResource(String path)
Specifies the classpath path containing the resource
|
| Modifier and Type | Method and Description |
|---|---|
Resource |
addPath(String pathParm)
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.
|
Object |
getAssociate() |
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
|
static InputStream |
getSeleniumResourceAsStream(String resourceFile) |
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 lastModified time, which is always in the distant future to prevent caching.
|
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 resources held by the resource.
|
boolean |
renameTo(Resource dest)
Rename the given resource
|
String |
toString() |
cache, encode, finalize, getAlias, getListHTML, newResource, newResource, newSystemResource, setAssociate, writeTopublic ClassPathResource(String path)
public static InputStream getSeleniumResourceAsStream(String resourceFile)
public Object getAssociate()
getAssociate in class Resourcepublic void release()
Resourcepublic boolean exists()
Resourcepublic boolean isDirectory()
ResourceisDirectory in class Resourcepublic long lastModified()
lastModified in class Resourcepublic long length()
Resourcepublic URL getURL()
Resourcepublic File getFile() throws IOException
ResourcegetFile in class ResourceIOExceptionpublic String getName()
Resourcepublic InputStream getInputStream() throws IOException
ResourcegetInputStream in class ResourceIOExceptionpublic OutputStream getOutputStream() throws IOException, SecurityException
ResourcegetOutputStream in class ResourceIOExceptionSecurityExceptionpublic boolean delete()
throws SecurityException
Resourcedelete in class ResourceSecurityExceptionpublic boolean renameTo(Resource dest) throws SecurityException
ResourcerenameTo in class ResourceSecurityExceptionpublic String[] list()
Resourcepublic Resource addPath(String pathParm) throws IOException, MalformedURLException
ResourceaddPath in class ResourcepathParm - The path segment to add, which should be encoded by the
encode method.IOExceptionMalformedURLExceptionCopyright © 2013. All rights reserved.