Commit 7ec93287 authored by Neumann, Mandy's avatar Neumann, Mandy

Trying to fix the file not found error for oxpath config

parent 7a115661
......@@ -5,11 +5,11 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.io.IOUtils;
import org.gesis.dda.publishing.domain.impl.OxpathBundlesStreamSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
......@@ -107,14 +107,11 @@ public class OxpathService {
private WebBrowser setupBrowser() {
final WebBrowser browser;
// for newer OXPath:
File configFile = new File(OxpathBundlesStreamSource.class.getResource("/oxpath/config.xml").getFile());
WebBrowserBuilder browserBuilder = new WebBrowserBuilder(new ConfigurationObjectFactory().create(configFile));
// the old way:
// WebBrowserBuilder browserBuilder = new WebBrowserBuilder();
// File configFile = new File(OxpathService.class.getResource("/oxpath/config.xml").getFile());
URL configFileUrl = OxpathService.class.getClassLoader().getResource("oxpath/config.xml");
WebBrowserBuilder browserBuilder = new WebBrowserBuilder(new ConfigurationObjectFactory().create(configFileUrl));
browserBuilder.getRunConfiguration().setDisabledContentTypes(WebBrowser.ContentType.IMAGE)
.setEnablePlugins(false).setXvfbMode(true);
browser = browserBuilder.build();
return browser;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment