Commit a88f4238 authored by Georgios Kolokythas's avatar Georgios Kolokythas
Browse files

Refactors file parsing on Config loader function.

parent 2d56ff06
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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 {