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 ResourceReference
null
if the Resource cannot be represented as a Filepublic URL asURL()
asURL
in interface ResourceReference
null
if the Resource cannot be represented as a URLpublic InputStream read() throws IOException
read
in interface ResourceReference
IOException
- if unable to obtain an InputStream from the resourcepublic boolean isAccessible()
ResourceReference
isAccessible
in interface ResourceReference
true
if the file can be accessed, false
otherwisepublic String getLocation()
getLocation
in interface ResourceReference
null
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 ResourceReference
Copyright © 2021 Apache NiFi Project. All rights reserved.