Package javax0.license3j.io
Class LicenseReader
- java.lang.Object
-
- javax0.license3j.io.LicenseReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class LicenseReader extends java.lang.Object implements java.io.CloseableReads a license from some input.
-
-
Constructor Summary
Constructors Constructor Description LicenseReader(java.io.File file)LicenseReader(java.io.InputStream is)LicenseReader(java.lang.String fileName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Licenseread()Read the license from the input assuming the license is binary formatted.Licenseread(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.
-
-
-
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 beIOFormat.STRING,IOFormat.BASE64orIOFormat.BINARY- Returns:
- the license
- Throws:
java.io.IOException- if the input cannot be read
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-