public class ClasspathResource extends AbstractResource implements Resource
Resource for classpath:// path.| Constructor and Description |
|---|
ClasspathResource(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.
|
String |
getDescription()
Return a description for this resource,
to be used for error output when working with the resource.
|
File |
getFile()
Return a File handle for this resource.
|
InputStream |
getInputStream()
Return an
InputStream. |
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 URL getURL()
ResourcegetURL in interface ResourcegetURL in class AbstractResource@Nonnull public File getFile()
ResourcegetFile in interface ResourcegetFile in class AbstractResource@Nonnull public InputStream getInputStream()
ResourceInputStream.
It is expected that each call creates a fresh stream.
getInputStream in interface Resourcenull)public String getDescription()
ResourceImplementations are also encouraged to return this value
from their toString method.
getDescription in interface ResourceObject.toString()Copyright © 2017. All Rights Reserved.