Refactors file parsing on Config loader function.

This commit is contained in:
gkolokythas 2020-01-15 14:09:32 +02:00
parent 2d56ff0676
commit a88f423864
1 changed files with 2 additions and 4 deletions

View File

@ -24,7 +24,6 @@ import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import java.io.*;
import java.net.URL;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@ -172,13 +171,12 @@ public class DevelConfigLoader implements ConfigLoader {
InputStream is = null;
Document doc;
try {
String current = new java.io.File(".").getCanonicalPath();
is = new URL("file:///" + current + filePath).openStream();
is = getClass().getClassLoader().getResource(filePath).openStream();
DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
doc = documentBuilder.parse(is);
return doc;
} catch (IOException | ParserConfigurationException | SAXException e) {
} catch (IOException | ParserConfigurationException | SAXException | NullPointerException e) {
e.printStackTrace();
} finally {
try {