Interface IQBPFileMgr

  • All Known Implementing Classes:
    DfltFileMgr

    public interface IQBPFileMgr
    Interface for opening files for reading. This interface defines a set of methods that provide an input stream for a file like data object. The file like object can be idenified either with a string name, or a File object.

    Implementations of this interface can perform security checks before allowing the file to be opened, and can map files to other storage devices, such as a DBMS or web service. The QBP classes use implementations of this interface to open all configuration files. This provides a flexible means of enforcing security restrictions, and allows the QBP classes to be used in environments where the configuration data is not stored on a traditional file system.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.io.InputStream getReaderFor​(java.io.File file_id)
      Get an input stream reader for a file identified by a File object.
      java.io.InputStream getReaderFor​(java.lang.String data_source)
      Get an input stream reader for a file identified by a string value.
      java.lang.String verify​(java.io.File data_file)
      Check if a File is a valid data source.
      java.lang.String verify​(java.lang.String data_source)
      Check a data source for validity.
    • Method Detail

      • verify

        java.lang.String verify​(java.lang.String data_source)
        Check a data source for validity.
        Parameters:
        data_source - a string identifying the data source to be verified.
        Returns:
        if the data source appears valid null is returned, if the data source is invalid a descriptive string is returned.
      • verify

        java.lang.String verify​(java.io.File data_file)
        Check if a File is a valid data source.
        Parameters:
        data_file - a file object identifying the data source.
        Returns:
        if the File appears valid null is returned, if the File is invalid a descriptive string is returned.
      • getReaderFor

        java.io.InputStream getReaderFor​(java.lang.String data_source)
                                  throws java.io.FileNotFoundException,
                                         java.lang.IllegalArgumentException,
                                         java.lang.Exception
        Get an input stream reader for a file identified by a string value. This provides an input stream for a named data source. The source may be a file, identified by a standard path name, or it may be some other device, identified by a string value of any chosen format.
        Parameters:
        data_source - the string value identifying the data source.
        Returns:
        an open InputStream for the data_source. The position of the stream is on the first byte of data.
        Throws:
        java.io.FileNotFoundException - if there is no such data source.
        java.lang.IllegalArgumentException - if data_source is null, has an invalid format, or if access is denied for security reasons.
        java.lang.Exception - it may throw a general exception for other errors.
      • getReaderFor

        java.io.InputStream getReaderFor​(java.io.File file_id)
                                  throws java.io.FileNotFoundException,
                                         java.lang.IllegalArgumentException,
                                         java.lang.UnsupportedOperationException,
                                         java.lang.Exception
        Get an input stream reader for a file identified by a File object. This provides an input stream for the given file.
        Parameters:
        file_id - the file to be read.
        Returns:
        an open InputStream for the file. The position of the stream is on the first byte of data.
        Throws:
        java.io.FileNotFoundException - if there is no such file.
        java.lang.IllegalArgumentException - if file_id is null, or if access is denied for security reasons.
        java.lang.UnsupportedOperationException - if reading from files is not supported.
        java.lang.Exception - it may throw a general exception of other errors.