// For complete examples and data files, please go to https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java
/**
* This method applies product license from stream
*
*/
public static void applyLicenseFromStream(String filePath) {
try {
// Obtain license stream
FileInputStream licenseStream = new FileInputStream(filePath);
// Setup license
com.groupdocs.viewer.licensing.License lic = new com.groupdocs.viewer.licensing.License();
lic.setLicense(licenseStream);
} catch (Exception exp) {
System.out.println("Exception: " + exp.getMessage());
exp.printStackTrace();
}
}