Unable to read License file

Hi Chetan,


Can you tell us what needs to be done to read the License file at server level?
Yes, you can conveniently read license file from server using stream object. Code given below is particularly written to meet your needs.

URL url;
try {
url = new URL(“http://somewebsite.com/groupdocs.viewer.java.lic”);
InputStream licenseStream = url.openStream();
License license = new License();
license.setLicense(licenseStream);
if (!License.isValidLicense()) {
throw new RuntimeException(“License is not valid”);
}
else{
System.out.println(“…License file was loaded”);
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Throwable e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Please read license file this way and share your experience. It will certainly help you out.

Best regards