public class FileResourceReference extends Object implements ResourceReference
| Modifier and Type | Field and Description |
|---|---|
private File |
file |
private ResourceType |
resourceType |
| Constructor and Description |
|---|
FileResourceReference(File file) |
| Modifier and Type | Method and Description |
|---|---|
File |
asFile() |
URL |
asURL() |
boolean |
equals(Object o) |
String |
getLocation() |
ResourceType |
getResourceType() |
int |
hashCode() |
boolean |
isAccessible()
Indicates whether or not the resource is accessible.
|
InputStream |
read() |
String |
toString() |
private final File file
private final ResourceType resourceType
public FileResourceReference(File file)
public File asFile()
asFile in interface ResourceReferencenull if the Resource cannot be represented as a Filepublic URL asURL()
asURL in interface ResourceReferencenull if the Resource cannot be represented as a URLpublic InputStream read() throws IOException
read in interface ResourceReferenceIOException - if unable to obtain an InputStream from the resourcepublic boolean isAccessible()
ResourceReferenceisAccessible in interface ResourceReferencetrue if the file can be accessed, false otherwisepublic String getLocation()
getLocation in interface ResourceReferencenull for a Resource that does not have an external location.
For a File or a Directory, this will be the full path name; for a URL it will be the String form of the URLpublic ResourceType getResourceType()
getResourceType in interface ResourceReferenceCopyright © 2023 Apache NiFi Project. All rights reserved.