ListFile

Description:

Retrieves a listing of files from the local filesystem. For each file that is listed, creates a FlowFile that represents the file so that it can be fetched in conjunction with FetchFile. This Processor is designed to run on Primary Node only in a cluster. If the primary node changes, the new Primary Node will pick up where the previous node left off without duplicating all of the data. Unlike GetFile, this Processor does not delete any data from the local filesystem.

Tags:

file, get, list, ingest, source, filesystem

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

NameDefault ValueAllowable ValuesDescription
Input DirectoryThe input directory from which files to pull files
Supports Expression Language: true
Recurse Subdirectoriestrue
  • true
  • false
Indicates whether to list files from subdirectories of the directory
Input Directory LocationLocal
  • Local Input Directory is located on a local disk. State will be stored locally on each node in the cluster.
  • Remote Input Directory is located on a remote system. State will be stored across the cluster so that the listing can be performed on Primary Node Only and another node can pick up where the last node left off, if the Primary Node changes
Specifies where the Input Directory is located. This is used to determine whether state should be stored locally or across the cluster.
File Filter[^\.].*Only files whose names match the given regular expression will be picked up
Path FilterWhen Recurse Subdirectories is true, then only subdirectories whose path matches the given regular expression will be scanned
Minimum File Age0 secThe minimum age that a file must be in order to be pulled; any file younger than this amount of time (according to last modification date) will be ignored
Maximum File AgeThe maximum age that a file must be in order to be pulled; any file older than this amount of time (according to last modification date) will be ignored
Minimum File Size0 BThe minimum size that a file must be in order to be pulled
Maximum File SizeThe maximum size that a file can be in order to be pulled
Ignore Hidden Filestrue
  • true
  • false
Indicates whether or not hidden files should be ignored
Target System Timestamp Precisionauto-detect
  • Auto Detect Automatically detect time unit deterministically based on candidate entries timestamp. Please note that this option may take longer to list entities unnecessarily, if none of entries has a precise precision timestamp. E.g. even if a target system supports millis, if all entries only have timestamps without millis, such as '2017-06-16 09:06:34.000', then its precision is determined as 'seconds'.
  • Milliseconds This option provides the minimum latency for an entry from being available to being listed if target system supports millis, if not, use other options.
  • Seconds For a target system that does not have millis precision, but has in seconds.
  • Minutes For a target system that only supports precision in minutes.
Specify timestamp precision at the target system. Since this processor uses timestamp of entities to decide which should be listed, it is crucial to use the right timestamp precision.

Relationships:

NameDescription
successAll FlowFiles that are received are routed to success

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
filenameThe name of the file that was read from filesystem.
pathThe path is set to the relative path of the file's directory on filesystem compared to the Input Directory property. For example, if Input Directory is set to /tmp, then files picked up from /tmp will have the path attribute set to "/". If the Recurse Subdirectories property is set to true and a file is picked up from /tmp/abc/1/2/3, then the path attribute will be set to "abc/1/2/3/".
absolute.pathThe absolute.path is set to the absolute path of the file's directory on filesystem. For example, if the Input Directory property is set to /tmp, then files picked up from /tmp will have the path attribute set to "/tmp/". If the Recurse Subdirectories property is set to true and a file is picked up from /tmp/abc/1/2/3, then the path attribute will be set to "/tmp/abc/1/2/3/".
file.ownerThe user that owns the file in filesystem
file.groupThe group that owns the file in filesystem
file.sizeThe number of bytes in the file in filesystem
file.permissionsThe permissions for the file in filesystem. This is formatted as 3 characters for the owner, 3 for the group, and 3 for other users. For example rw-rw-r--
file.lastModifiedTimeThe timestamp of when the file in filesystem was last modified as 'yyyy-MM-dd'T'HH:mm:ssZ'
file.lastAccessTimeThe timestamp of when the file in filesystem was last accessed as 'yyyy-MM-dd'T'HH:mm:ssZ'
file.creationTimeThe timestamp of when the file in filesystem was created as 'yyyy-MM-dd'T'HH:mm:ssZ'

State management:

ScopeDescription
LOCAL, CLUSTERAfter performing a listing of files, the timestamp of the newest file is stored. This allows the Processor to list only files that have been added or modified after this date the next time that the Processor is run. Whether the state is stored with a Local or Cluster scope depends on the value of the <Input Directory Location> property.

Restricted:

This component is not restricted.

Input requirement:

This component does not allow an incoming relationship.

See Also:

GetFile, PutFile, FetchFile