use of org.codelibs.fess.util.GsaConfigParser in project fess by codelibs.
the class AdminBackupAction method importGsaXml.
private void importGsaXml(final String fileName, final File tempFile) {
final GsaConfigParser configParser = ComponentUtil.getComponent(GsaConfigParser.class);
try (final InputStream in = new FileInputStream(tempFile)) {
configParser.parse(new InputSource(in));
} catch (final IOException e) {
logger.warn("Failed to process gsa.xml file: {}", fileName, e);
} finally {
deleteTempFile(tempFile);
}
configParser.getWebConfig().ifPresent(c -> webConfigBhv.insert(c));
configParser.getFileConfig().ifPresent(c -> fileConfigBhv.insert(c));
labelTypeBhv.batchInsert(Arrays.stream(configParser.getLabelTypes()).collect(Collectors.toList()));
}
Aggregations