Class ListFile

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processor.util.list.AbstractListProcessor<FileInfo>
org.apache.nifi.processors.standard.ListFile
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor, org.apache.nifi.processor.VerifiableProcessor

@TriggerSerially @InputRequirement(INPUT_FORBIDDEN) @Tags({"file","get","list","ingest","source","filesystem"}) @CapabilityDescription("Retrieves a listing of files from the input directory. For each file 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 when \'Input Directory Location\' is set to \'Remote\'. If the primary node changes, the new Primary Node will pick up where the previous node left off without duplicating all the data. When \'Input Directory Location\' is \'Local\', the \'Execution\' mode can be anything, and synchronization won\'t happen. Unlike GetFile, this Processor does not delete any data from the local filesystem.") @WritesAttribute(attribute="filename",description="The name of the file that was read from filesystem.") @WritesAttribute(attribute="path",description="The 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/\".") @WritesAttribute(attribute="absolute.path",description="The 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/\".") @WritesAttribute(attribute="file.owner",description="The user that owns the file in filesystem") @WritesAttribute(attribute="file.group",description="The group that owns the file in filesystem") @WritesAttribute(attribute="file.size",description="The number of bytes in the file in filesystem") @WritesAttribute(attribute="file.permissions",description="The 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--") @WritesAttribute(attribute="file.lastModifiedTime",description="The timestamp of when the file in filesystem was last modified as \'yyyy-MM-dd\'T\'HH:mm:ssZ\'") @WritesAttribute(attribute="file.lastAccessTime",description="The timestamp of when the file in filesystem was last accessed as \'yyyy-MM-dd\'T\'HH:mm:ssZ\'") @WritesAttribute(attribute="file.creationTime",description="The timestamp of when the file in filesystem was created as \'yyyy-MM-dd\'T\'HH:mm:ssZ\'") @SeeAlso({GetFile.class,PutFile.class,FetchFile.class}) @Stateful(scopes={LOCAL,CLUSTER}, description="After 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.") @DefaultSchedule(strategy=TIMER_DRIVEN, period="1 min") public class ListFile extends AbstractListProcessor<FileInfo>
  • Field Details

    • LOCATION_LOCAL

      static final org.apache.nifi.components.AllowableValue LOCATION_LOCAL
    • LOCATION_REMOTE

      static final org.apache.nifi.components.AllowableValue LOCATION_REMOTE
    • DIRECTORY

      public static final org.apache.nifi.components.PropertyDescriptor DIRECTORY
    • RECURSE

      public static final org.apache.nifi.components.PropertyDescriptor RECURSE
    • DIRECTORY_LOCATION

      public static final org.apache.nifi.components.PropertyDescriptor DIRECTORY_LOCATION
    • FILE_FILTER

      public static final org.apache.nifi.components.PropertyDescriptor FILE_FILTER
    • PATH_FILTER

      public static final org.apache.nifi.components.PropertyDescriptor PATH_FILTER
    • INCLUDE_FILE_ATTRIBUTES

      public static final org.apache.nifi.components.PropertyDescriptor INCLUDE_FILE_ATTRIBUTES
    • MIN_AGE

      public static final org.apache.nifi.components.PropertyDescriptor MIN_AGE
    • MAX_AGE

      public static final org.apache.nifi.components.PropertyDescriptor MAX_AGE
    • MIN_SIZE

      public static final org.apache.nifi.components.PropertyDescriptor MIN_SIZE
    • MAX_SIZE

      public static final org.apache.nifi.components.PropertyDescriptor MAX_SIZE
    • IGNORE_HIDDEN_FILES

      public static final org.apache.nifi.components.PropertyDescriptor IGNORE_HIDDEN_FILES
    • TRACK_PERFORMANCE

      public static final org.apache.nifi.components.PropertyDescriptor TRACK_PERFORMANCE
    • MAX_TRACKED_FILES

      public static final org.apache.nifi.components.PropertyDescriptor MAX_TRACKED_FILES
    • MAX_DISK_OPERATION_TIME

      public static final org.apache.nifi.components.PropertyDescriptor MAX_DISK_OPERATION_TIME
    • MAX_LISTING_TIME

      public static final org.apache.nifi.components.PropertyDescriptor MAX_LISTING_TIME
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • monitoringThreadPool

      private volatile ScheduledExecutorService monitoringThreadPool
    • monitoringFuture

      private volatile Future<?> monitoringFuture
    • includeFileAttributes

      private volatile boolean includeFileAttributes
    • performanceTracker

      private volatile ListFile.PerformanceTracker performanceTracker
    • performanceLoggingTimestamp

      private volatile long performanceLoggingTimestamp
    • FILE_CREATION_TIME_ATTRIBUTE

      public static final String FILE_CREATION_TIME_ATTRIBUTE
      See Also:
    • FILE_LAST_MODIFY_TIME_ATTRIBUTE

      public static final String FILE_LAST_MODIFY_TIME_ATTRIBUTE
      See Also:
    • FILE_LAST_ACCESS_TIME_ATTRIBUTE

      public static final String FILE_LAST_ACCESS_TIME_ATTRIBUTE
      See Also:
    • FILE_SIZE_ATTRIBUTE

      public static final String FILE_SIZE_ATTRIBUTE
      See Also:
    • FILE_OWNER_ATTRIBUTE

      public static final String FILE_OWNER_ATTRIBUTE
      See Also:
    • FILE_GROUP_ATTRIBUTE

      public static final String FILE_GROUP_ATTRIBUTE
      See Also:
    • FILE_PERMISSIONS_ATTRIBUTE

      public static final String FILE_PERMISSIONS_ATTRIBUTE
      See Also:
    • FILE_MODIFY_DATE_ATTR_FORMAT

      public static final String FILE_MODIFY_DATE_ATTR_FORMAT
      See Also:
    • DATE_TIME_FORMATTER

      private static final DateTimeFormatter DATE_TIME_FORMATTER
  • Constructor Details

    • ListFile

      public ListFile()
  • Method Details