Class StandardResourceReferences
java.lang.Object
org.apache.nifi.components.resource.StandardResourceReferences
- All Implemented Interfaces:
ResourceReferences
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addChildren
(File file, List<ResourceReference> flattened) asList()
asURLs()
boolean
flatten()
Iterates through the Resource References and for any reference that may represent more than one resource, flattens the resource into a List of single-entity references.Recursively iterates through the Resource References and for any reference that may represent more than one resource, flattens the resource into a List of single-entity references.int
getCount()
int
hashCode()
private void
recurse
(File file, List<ResourceReference> flattened) toString()
-
Field Details
-
resourceReferences
-
-
Constructor Details
-
StandardResourceReferences
-
-
Method Details
-
asList
- Specified by:
asList
in interfaceResourceReferences
- Returns:
- a List representation of all Resource References
-
asLocations
- Specified by:
asLocations
in interfaceResourceReferences
- Returns:
- a list of all Resource References' locations
-
asURLs
- Specified by:
asURLs
in interfaceResourceReferences
- Returns:
- a list of all Resource References' URLs
-
getCount
public int getCount()- Specified by:
getCount
in interfaceResourceReferences
- Returns:
- the number of Resource References held
-
flatten
Description copied from interface:ResourceReferences
Iterates through the Resource References and for any reference that may represent more than one resource, flattens the resource into a List of single-entity references. For example, consider that this ResourceReferences holds a single ResourceReference, of type DIRECTORY and the referenced directory contains 10 files. CallingResourceReferences.asList()
would return a single ResourceReference. But callingflatten()
would return a new ResourceReferences type whoseResourceReferences.asList()
method would return 10 ResourceReference objects, each with a ResourceType of FILE. The flatten operation is not recursive, meaning that if a DIRECTORY is flattened, any sub-directories will be dropped. If the contents of the subdirectories are to be retained, useResourceReferences.flattenRecursively()
instead.- Specified by:
flatten
in interfaceResourceReferences
- Returns:
- a flattened ResourceReferences
-
addChildren
-
flattenRecursively
Description copied from interface:ResourceReferences
Recursively iterates through the Resource References and for any reference that may represent more than one resource, flattens the resource into a List of single-entity references. For example, consider that this ResourceReferences holds a single ResourceReference, of type DIRECTORY and the referenced directory contains 10 files. CallingResourceReferences.asList()
would return a single ResourceReference. But callingflatten()
would return a new ResourceReferences type whoseResourceReferences.asList()
method would return 10 ResourceReference objects, each with a ResourceType of FILE. The flatten operation is recursive, meaning that if a DIRECTORY is encountered, its reference will be replaced with a new reference for each file, even if that file exists 100 levels deep in the directory structure.- Specified by:
flattenRecursively
in interfaceResourceReferences
- Returns:
- a flattened ResourceReferences
-
recurse
-
equals
-
hashCode
public int hashCode() -
toString
-