License

Inheritance: java.lang.Object

public class License

Provides methods to license the component and unlock its full functionality.

The License class allows you to apply a valid license to the GroupDocs.Viewer component, enabling you to utilize all the features and remove any evaluation limitations.

Example usage:


 License license = new License();
 license.setLicense("path/to/license/file.lic");
 

Constructors

Constructor Description
License()

Methods

Method Description
resetLicense()
setLicense(InputStream licenseStream) Licenses the component.
setLicense(Path licensePath) Licenses the component.
setLicense(String licensePath) Licenses the component.
setLicense(URL licenseUri) Licenses the component.
isLicensed()

License()

public License()

resetLicense()

public static void resetLicense()

setLicense(InputStream licenseStream)

public final void setLicense(InputStream licenseStream)

Licenses the component.

The following example demonstrates how to set a license passing InputStream of the license file.

For more information about licensing, please refer to the GroupDocs Licensing FAQ. You can also find detailed information about GroupDocs.Viewer licensing in the Evaluation Limitations and Licensing documentation.

Example:


 FileInputStream licenseStream = new FileInputStream("LicenseFile.lic");
 License license = new License();
 license.setLicense(licenseStream);
 

Parameters:

Parameter Type Description
licenseStream java.io.InputStream The license stream.

setLicense(Path licensePath)

public final void setLicense(Path licensePath)

Licenses the component.

Sets the license for the component using the specified license path.

Note: This method should be called before using any functionality of the component.

Parameters:

Parameter Type Description
licensePath java.nio.file.Path The license path.

setLicense(String licensePath)

public final void setLicense(String licensePath)

Licenses the component.

This method should be called before using any functionality.

Example usage:


 String licensePath = "GroupDocs.Viewer.lic";
 License license = new License();
 license.setLicense(licensePath);
 

Parameters:

Parameter Type Description
licensePath java.lang.String The license path or url.

setLicense(URL licenseUri)

public void setLicense(URL licenseUri)

Licenses the component.

This method should be called before using any functionality.

Parameters:

Parameter Type Description
licenseUri java.net.URL The license URI.

isLicensed()

public final boolean isLicensed()

Returns: boolean