Commit a88f4238 authored by Georgios Kolokythas's avatar Georgios Kolokythas

Refactors file parsing on Config loader function.

parent 2d56ff06
......@@ -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 {
......
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