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.Closeable
Reads 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 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.
-
-
-
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.BASE64
orIOFormat.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 interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-