Class FileResourceReference
java.lang.Object
org.apache.nifi.components.resource.FileResourceReference
- All Implemented Interfaces:
ResourceReference
-
Field Details
-
file
-
resourceType
-
-
Constructor Details
-
FileResourceReference
-
-
Method Details
-
asFile
- Specified by:
asFile
in interfaceResourceReference
- Returns:
- a file representation of the resource, or
null
if the Resource cannot be represented as a File
-
asURL
- Specified by:
asURL
in interfaceResourceReference
- Returns:
- a URL representation of the resource, or
null
if the Resource cannot be represented as a URL
-
read
- Specified by:
read
in interfaceResourceReference
- Returns:
- an InputStream to read the contents of the resource
- Throws:
IOException
- if unable to obtain an InputStream from the resource
-
isAccessible
public boolean isAccessible()Description copied from interface:ResourceReference
Indicates whether or not the resource is accessible. What it means for the resource to be accessible depends on the type of resource. A File resource, for example, might be accessible only if the file exists and is readable, while a URL resource might always be considered accessible, or might be accesssible only if the existence of the resource can be confirmed.- Specified by:
isAccessible
in interfaceResourceReference
- Returns:
true
if the file can be accessed,false
otherwise
-
getLocation
- Specified by:
getLocation
in interfaceResourceReference
- Returns:
- a String representation of the location, or
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 URL
-
getResourceType
- Specified by:
getResourceType
in interfaceResourceReference
- Returns:
- the type of resource that is being referenced
-
equals
-
hashCode
public int hashCode() -
toString
-