Class ReaderDataSource

  • All Implemented Interfaces:
    DataSource

    public class ReaderDataSource
    extends java.lang.Object
    implements DataSource
    DataSource implementation to read data from a Reader.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReaderDataSource​(java.io.Reader reader, java.lang.String dataSourceName)
      Create the DataSource from the Reader.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDataSourceName()  
      java.io.InputStream getInputStream()
      Convert the Reader into an InputStream.
      java.lang.String getNiceFileName​(boolean shortNames, java.lang.String inputFileName)
      Return the dataSourceName via the DataSource Interface method.
      void setDataSourceName​(java.lang.String dataSourceName)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • ReaderDataSource

        public ReaderDataSource​(java.io.Reader reader,
                                java.lang.String dataSourceName)
        Create the DataSource from the Reader.
    • Method Detail

      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Convert the Reader into an InputStream.

        Note: This uses the default encoding.

        Specified by:
        getInputStream in interface DataSource
        Returns:
        Derived InputStream
        Throws:
        java.io.IOException
      • getNiceFileName

        public java.lang.String getNiceFileName​(boolean shortNames,
                                                java.lang.String inputFileName)
        Return the dataSourceName via the DataSource Interface method.

        Both the parameters are ignored

        Specified by:
        getNiceFileName in interface DataSource
        Parameters:
        shortNames - ignored
        inputFileName - ignored
        Returns:
      • getDataSourceName

        public java.lang.String getDataSourceName()
        Returns:
        the dataSourceName
      • setDataSourceName

        public void setDataSourceName​(java.lang.String dataSourceName)
        Parameters:
        dataSourceName - the dataSourceName to set
      • toString

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