Class FileDataSource

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, DataSource

    public class FileDataSource
    extends AbstractDataSource
    DataSource implementation to read data from a file.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileDataSource​(java.io.File file)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.io.InputStream getInputStream()
      Get an InputStream on the source file.
      java.lang.String getNiceFileName​(boolean shortNames, java.lang.String inputPaths)
      Return a nice version of the filename.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FileDataSource

        public FileDataSource​(java.io.File file)
        Parameters:
        file - the file to read
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Description copied from interface: DataSource
        Get an InputStream on the source file.
        Returns:
        the InputStream reading the source file
        Throws:
        java.io.IOException - if the file can't be opened
      • getNiceFileName

        public java.lang.String getNiceFileName​(boolean shortNames,
                                                java.lang.String inputPaths)
        Description copied from interface: DataSource
        Return a nice version of the filename.
        Parameters:
        shortNames - true if short names are being used
        inputPaths - name of a "master" file this file is relative to
        Returns:
        String
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object