Class LicenseReader

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

    public class LicenseReader
    extends java.lang.Object
    implements java.io.Closeable
    Reads a license from some input.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      License read()
      Read the license from the input assuming the license is binary formatted.
      License read​(IOFormat format)
      Read the license from the input assuming that the format of the license on the input has the format specified by the argument.
      • Methods inherited from class java.lang.Object

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

      • LicenseReader

        public LicenseReader​(java.io.InputStream is)
      • LicenseReader

        public LicenseReader​(java.io.File file)
                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
      • LicenseReader

        public LicenseReader​(java.lang.String fileName)
                      throws java.io.FileNotFoundException
        Throws:
        java.io.FileNotFoundException
    • Method Detail

      • read

        public License read()
                     throws java.io.IOException
        Read the license from the input assuming the license is binary formatted.
        Returns:
        the license created from the file
        Throws:
        java.io.IOException - when the file cannot be read
      • read

        public License read​(IOFormat format)
                     throws java.io.IOException
        Read the license from the input assuming that the format of the license on the input has the format specified by the argument.
        Parameters:
        format - the assumed format of the license, can be IOFormat.STRING, IOFormat.BASE64 or IOFormat.BINARY
        Returns:
        the license
        Throws:
        java.io.IOException - if the input cannot be read
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException