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