Interface FileSource

All Superinterfaces:
JsonSerializable, RecordSerializable, XmlSerializable
All Known Implementing Classes:
AmazonS3FileSource, LocalFileSource, ProxyFileSource

public interface FileSource extends RecordSerializable, XmlSerializable
A local or remote file to read, supplying an InputStream for its content.
  • Method Details

    • getName

      String getName()
    • getPath

      String getPath()
    • getUrlPath

      String getUrlPath()
    • isLocal

      boolean isLocal()
      Indicates if the file is on the local file system.
    • getFileSize

      long getFileSize()
      Returns the size of the file in bytes.
    • getContentType

      String getContentType()
    • getFileType

      FileType getFileType()
      Returns the format of the file, or null if it is unknown.
    • getInputStream

      InputStream getInputStream()
      Opens a new stream to read the file's content; the caller must close it.
    • fromRecord

      FileSource fromRecord(Record source)
      Description copied from interface: RecordSerializable
      Loads this instance's state from a record and returns this (for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.
      Specified by:
      fromRecord in interface RecordSerializable
      Parameters:
      source -
      Returns:
      this instance.