Class LicenseReader

    • Constructor Detail

      • LicenseReader

        public LicenseReader​(InputStream is)
        Create a new license reader that will read the license from the input stream. Note that using this version of LicenseReader does not provide any protection against enormously and erroneously large input. The caller has to make sure the source of the input stream is really a license file and that it is not too large for the application with the actual memory settings.
        Parameters:
        is - the input stream from which the license is to be read
      • LicenseReader

        public LicenseReader​(File file,
                             long limit)
                      throws FileNotFoundException
        Create a new license reader that will read the license from the file. If the size of the file is larger than the given limit then this constructor will throw illegal argument exception.
        Parameters:
        file - the file that contains the license
        limit - the maximum number of bytes of the license that the program can handle
        Throws:
        FileNotFoundException - if the file cannot be found
      • LicenseReader

        public LicenseReader​(File file)
                      throws FileNotFoundException
        Create a new license reader that will read the license from the file. This constructor simply opens an input stream from the file and calls LicenseReader(InputStream). See the notes there about the size limits.
        Parameters:
        file - the file that contains the license
        Throws:
        FileNotFoundException - if the file cannot be found
      • LicenseReader

        public LicenseReader​(String fileName,
                             long limit)
                      throws FileNotFoundException
        Create a new license reader that will read the license from the file named. This constructor simply opens an input stream from the file and calls LicenseReader(File, long). See the notes there about the size limits.
        Parameters:
        fileName - the name of the file
        limit - the maximum number of bytes of the license that the program can handle
        Throws:
        FileNotFoundException - if the file cannot be found
      • LicenseReader

        public LicenseReader​(String fileName)
                      throws FileNotFoundException
        Create a new license reader that will read the license from the file named. This constructor simply opens an input stream from the file and calls LicenseReader(File). See the notes there about the size limits.
        Parameters:
        fileName - the name of the file
        Throws:
        FileNotFoundException - if the file cannot be found