License

Inheritance: java.lang.Object

public class License

Provides methods to license the component.

Constructors

ConstructorDescription
License()Initializes a new instance of this class.

Methods

MethodDescription
setLicense(String licenseName)Licenses the component.
setLicense(InputStream stream)Licenses the component.
setLicense(File licenseFile)Licenses the component.
resetThreadContext()Resets a license context for curent thread.
setThreadContext(InputStream stream)Sets a license context for current thread.

License()

public License()

Initializes a new instance of this class.

setLicense(String licenseName)

public final void setLicense(String licenseName)

Licenses the component.

Parameters:

ParameterTypeDescription
licenseNamejava.lang.StringCan be a full or short file name or name of an embedded resource . Use an empty string to switch to evaluation mode.

Tries to find the license in the following locations:

  1. Explicit path.

  2. The folder that contains the Aspose component assembly.

  3. The folder that contains the client’s calling assembly.

  4. The folder that contains the entry (startup) assembly.

  5. An embedded resource in the client’s calling assembly.

**Note:**On the .NET Compact Framework, tries to find the license only in these locations:

  1. Explicit path.

  2. An embedded resource in the client’s calling assembly.

  3. The folder that contains the Aspose component JAR file.

  4. The folder that contains the client’s calling JAR file.

|

setLicense(InputStream stream)

public final void setLicense(InputStream stream)

Licenses the component.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamA stream that contains the license.

Use this method to load a license from a stream.

void setLicense(java.io.InputStream stream) |

setLicense(File licenseFile)

public void setLicense(File licenseFile)

Licenses the component.

Parameters:

ParameterTypeDescription
licenseFilejava.io.FileFile of license System.IO.FileInfo .

resetThreadContext()

public static void resetThreadContext()

Resets a license context for curent thread.

setThreadContext(InputStream stream)

public static void setThreadContext(InputStream stream)

Sets a license context for current thread.

Parameters:

ParameterTypeDescription
streamjava.io.InputStreamA stream that contains the license.