Class FileSystemInfoReader


public class FileSystemInfoReader extends DataReader
Creates records from the metadata of files within a directory.
  • Constructor Details

    • FileSystemInfoReader

      public FileSystemInfoReader(File root)
  • Method Details

    • getFilter

      public FileFilter getFilter()
      Returns the filter applied to each directory listing (null accepts all); rejected directories are not recursed into.
    • setFilter

      public FileSystemInfoReader setFilter(FileFilter filter)
      Sets the filter applied to each directory listing (null accepts all); rejected directories are not recursed into.
    • getRecurseDirectories

      public boolean getRecurseDirectories()
      Indicates if sub-directories are read recursively (default is false).
    • setRecurseDirectories

      public FileSystemInfoReader setRecurseDirectories(boolean recurseDirectories)
      Indicates if sub-directories are read recursively (default is false).
    • getIncludeDirectories

      public boolean getIncludeDirectories()
      Indicates if directories are returned as records too, not just files (default is false).
    • setIncludeDirectories

      public FileSystemInfoReader setIncludeDirectories(boolean includeDirectories)
      Indicates if directories are returned as records too, not just files (default is false).
    • getAbsolutePaths

      public boolean getAbsolutePaths()
      Indicates if the path and parent fields keep the root directory's path as given instead of being relative to it (default is false).
    • setAbsolutePaths

      public FileSystemInfoReader setAbsolutePaths(boolean absolutePaths)
      Indicates if the path and parent fields keep the root directory's path as given instead of being relative to it (default is false).
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)
      Description copied from class: Endpoint
      Adds this endpoint's current state to a DataException. Since this method is called whenever an exception is thrown, subclasses should override it to add their specific information.
      Overrides:
      addExceptionProperties in class DataReader
    • open

      public void open() throws DataException
      Description copied from class: DataEndpoint
      Makes this endpoint ready for reading or writing.
      Overrides:
      open in class DataEndpoint
      Throws:
      DataException
    • close

      public void close()
      Description copied from class: DataEndpoint
      Indicates that this endpoint has finished reading or writing.
      Overrides:
      close in class DataEndpoint
    • readImpl

      protected Record readImpl() throws Throwable
      Description copied from class: DataReader
      Overridden by subclasses to read the next record from this DataReader. The default implementation of DataReader.read() now insures that this method will not be called again after it returns a null.

      If no record is available, null will be returned.

      Contract for subclasses (see also docs/authoring/DataReader.md):

      Specified by:
      readImpl in class DataReader
      Throws:
      Throwable