public class FileResource extends AbstractResource implements Resource
Resource for path/to/file.txt resources.| Constructor and Description |
|---|
FileResource(java.io.File file) |
FileResource(java.lang.String filePath) |
| Modifier and Type | Method and Description |
|---|---|
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.URI |
getURI()
Return a URI handle for this resource.
|
java.net.URL |
getURL()
Return a URL handle for this resource.
|
exists, lastModified, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexists, lastModifiedpublic FileResource(java.io.File file)
public FileResource(java.lang.String filePath)
@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)@Nonnull public java.net.URL getURL()
ResourcegetURL in interface ResourcegetURL in class AbstractResource@Nonnull public java.net.URI getURI()
ResourcegetURI in interface ResourcegetURI in class AbstractResourcepublic java.lang.String getDescription()
ResourceImplementations are also encouraged to return this value
from their toString method.
getDescription in interface ResourceObject.toString()Copyright © 2018. All Rights Reserved.