public class URLResourceReference extends Object implements ResourceReference
| Constructor and Description |
|---|
URLResourceReference(URL url) |
| Modifier and Type | Method and Description |
|---|---|
File |
asFile() |
URL |
asURL() |
String |
getLocation() |
ResourceType |
getResourceType() |
boolean |
isAccessible()
Indicates whether or not the resource is accessible.
|
InputStream |
read() |
String |
toString() |
private final URL url
public URLResourceReference(URL url)
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.