Skip to content
Permalink
Browse files
ANY23-321 Add openie toggle functionality to service
  • Loading branch information
lewismc committed Feb 23, 2018
1 parent 073190b commit 69109f36a2ee279c5f031423e16af6b49ea8dbfd
Showing 1 changed file with 9 additions and 1 deletion.
@@ -19,6 +19,8 @@

import org.apache.any23.configuration.DefaultConfiguration;
import org.apache.any23.extractor.ExtractionParameters;
import org.apache.any23.extractor.ExtractorRegistry;
import org.apache.any23.extractor.ExtractorRegistryImpl;
import org.apache.any23.http.HTTPClient;
import org.apache.any23.plugin.Any23PluginManager;
import org.apache.any23.servlet.conneg.Any23Negotiator;
@@ -100,7 +102,13 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IO
File openIEJarPath = new File(webappClasspath.getParentFile().getPath() + "/lib/apache-any23-openie");
boolean loadedJars = pManager.loadJARDir(openIEJarPath);
if (loadedJars) {
LOG.info("Successful dynamic classloading of apache-any23-openie directory from webapp lib.");
ExtractorRegistry r = ExtractorRegistryImpl.getInstance();
try {
pManager.getExtractors().forEachRemaining(r::register);
} catch (IOException e) {
LOG.error("Error during dynamic classloading of JARs from OpenIE runtime directory {}", openIEJarPath.toString(), e);
}
LOG.info("Successful dynamic classloading of JARs from OpenIE runtime directory {}", openIEJarPath.toString());
}
}
final ExtractionParameters eps = getExtractionParameters(req);

0 comments on commit 69109f3

Please sign in to comment.