public class ClasspathResource extends AbstractResource implements Resource
Resource for classpath:// path.| Constructor and Description |
|---|
ClasspathResource(java.lang.String path) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
exists()
This implementation checks whether a File can be opened,
falling back to whether an InputStream can be opened.
|
java.lang.String |
getDescription()
Return a description for this resource,
to be used for error output when working with the resource.
|
java.io.File |
getFile()
Return a File handle for this resource.
|
java.io.InputStream |
getInputStream()
Return an
InputStream. |
java.net.URL |
getURL()
Return a URL handle for this resource.
|
getURI, lastModified, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetURI, lastModifiedpublic boolean exists()
AbstractResourceexists in interface Resourceexists in class AbstractResource@Nonnull public java.net.URL getURL()
ResourcegetURL in interface ResourcegetURL in class AbstractResource@Nonnull public java.io.File getFile()
ResourcegetFile in interface ResourcegetFile in class AbstractResource@Nonnull public java.io.InputStream getInputStream()
ResourceInputStream.
It is expected that each call creates a fresh stream.
getInputStream in interface Resourcenull)public java.lang.String getDescription()
ResourceImplementations are also encouraged to return this value
from their toString method.
getDescription in interface ResourceObject.toString()Copyright © 2017. All Rights Reserved.