use of org.olat.core.util.vfs.FileStorage in project openolat by klemens.
the class CertificatesManagerImpl method afterPropertiesSet.
@Override
public void afterPropertiesSet() {
// create the folders
getCertificateTemplatesRoot();
templatesStorage = new FileStorage(getCertificateTemplatesRootContainer());
getCertificateRoot();
usersStorage = new FileStorage(getCertificateRootContainer());
Properties p = null;
try {
velocityEngine = new VelocityEngine();
p = new Properties();
p.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
p.setProperty("runtime.log.logsystem.log4j.category", "syslog");
velocityEngine.init(p);
} catch (Exception e) {
throw new RuntimeException("config error " + p.toString());
}
// deploy script
try (InputStream inRasteriez = CertificatesManager.class.getResourceAsStream("rasterize.js")) {
Path rasterizePath = getRasterizePath();
Files.copy(inRasteriez, rasterizePath, StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
log.error("Can not read rasterize.js library for PhantomJS PDF generation", e);
}
try (InputStream inQRCodeLib = CertificatesManager.class.getResourceAsStream("qrcode.min.js")) {
Path qrCodeLibPath = getQRCodeLibPath();
Files.copy(inQRCodeLib, qrCodeLibPath, StandardCopyOption.REPLACE_EXISTING);
} catch (Exception e) {
log.error("Can not read qrcode.min.js for QR Code PDF generation", e);
}
// start the queues
try {
startQueue();
} catch (JMSException e) {
log.error("", e);
}
}
Aggregations