use of org.artofsolving.jodconverter.office.OfficeManager in project openmeetings by apache.
the class DocumentConverter method createOfficeManager.
public static void createOfficeManager(String officePath, Consumer<OfficeManager> consumer) {
OfficeManager manager = null;
try {
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
if (!Strings.isEmpty(officePath)) {
configuration.setOfficeHome(officePath);
}
manager = configuration.buildOfficeManager();
manager.start();
if (consumer != null) {
consumer.accept(manager);
}
} finally {
if (manager != null) {
manager.stop();
}
}
}
Aggregations