public class License extends Object
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");
| Constructor and Description |
|---|
License() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isLicensed() |
static void |
resetLicense() |
void |
setLicense(InputStream licenseStream)
Licenses the component.
|
void |
setLicense(Path licensePath)
Licenses the component.
|
void |
setLicense(String licensePath)
Licenses the component.
|
void |
setLicense(URL licenseUri)
Licenses the component.
|
public final boolean isLicensed()
public static void resetLicense()
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);
licenseStream - The license stream.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.
licensePath - The license path.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);
licensePath - The license path or url.IllegalArgumentException - licensePath is a zero-length string, null, contains only white space, or contains one or more invalid characters.GroupDocsViewerException - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.FileNotFoundException - The specified path is invalid, (for example, it is on an unmapped drive).UnsupportedOperationException - licensePath is in an invalid format.public void setLicense(URL licenseUri)
Licenses the component.
This method should be called before using any functionality.
licenseUri - The license URI.Copyright © 2024. All rights reserved.