Hello,
I have developed a plugin which uses Aspose license.
The license file (Aspose.Words.lic) is copied under META-INF\lib\ directory.
The license file reference is made using following code:
license.setLicense("META-INF/lib/Aspose.Words.lic");
The plugin JAR contains the Aspose.Words.lic as part of it, however the plugin fails and it seems code is not able to locate the license file.
Any pointers in this regard will be greatly appreciated.
Regards,
Abhay
Discussion posts and replies are publicly visible
Using resource stream resolved the issue.
Mentioning details below for the benefit of other people.
Plugin code directory structure.
Some Guidelines:
The structure of plugin JAR after export will look like following
Code for making reference to resource.
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream is = cl.getResourceAsStream("Aspose.Words.lic");
com.aspose.words.License license = new com.aspose.words.License();
license.setLicense(is);
if (license.isLicensed()) {
log.debug("License is Set");
}
else{
log.debug("License NOT Set");