Commits

tbrugz committed f2ba771

better logging & resource loading

Comments (0)

Files changed (3)

graphml-snippets.properties

-gxl=<?xml version="1.0" encoding="UTF-8"?>\
-<!DOCTYPE gxl SYSTEM "http://www.gupro.de/GXL/gxl-1.0.dtd">\
-<gxl xmlns:xlink=" http://www.w3.org/1999/xlink">\
-  <graph id="simpleExample-instance" edgeids=" true" edgemode=" directed" hypergraph=" false">\
-    <type xlink:href="http://www.gupro.de/GXL/examples/schema/gxl/simpleExample/simpleExampleSchema.gxl#simpleExampleSchema" xlink:type=" simple"/>
-
-graphml=<?xml version="1.0" encoding="UTF-8"?>\n\
-<graphml xmlns="http://graphml.graphdrawing.org/xmlns" \
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
-    xmlns:y="http://www.yworks.com/xml/graphml" \
-    xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">\n\
-  <key for="node" id="d0" yfiles.type="nodegraphics"/>\n\
-  <key for="edge" id="d6" yfiles.type="edgegraphics"/>\n\
-  <graph id="G" edgedefault="directed">
-
-node=<data key="d0">\
-        <y:ShapeNode>\
-          <y:Geometry height="20.0" width="45"/>\
-          <y:NodeLabel alignment="center" fontFamily="Dialog" fontSize="9">{0}</y:NodeLabel>\
-        </y:ShapeNode>\
-      </data>
-
-edge=<data key="d6">\
-        <y:PolyLineEdge>\
-          <y:Arrows source="none" target="standard"/>\
-        </y:PolyLineEdge>\
-      </data>
-      

src/graphml-snippets.properties

+gxl=<?xml version="1.0" encoding="UTF-8"?>\
+<!DOCTYPE gxl SYSTEM "http://www.gupro.de/GXL/gxl-1.0.dtd">\
+<gxl xmlns:xlink=" http://www.w3.org/1999/xlink">\
+  <graph id="simpleExample-instance" edgeids=" true" edgemode=" directed" hypergraph=" false">\
+    <type xlink:href="http://www.gupro.de/GXL/examples/schema/gxl/simpleExample/simpleExampleSchema.gxl#simpleExampleSchema" xlink:type=" simple"/>
+
+graphml=<?xml version="1.0" encoding="UTF-8"?>\n\
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" \
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
+    xmlns:y="http://www.yworks.com/xml/graphml" \
+    xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">\n\
+  <key for="node" id="d0" yfiles.type="nodegraphics"/>\n\
+  <key for="edge" id="d6" yfiles.type="edgegraphics"/>\n\
+  <graph id="G" edgedefault="directed">
+
+node=<data key="d0">\
+        <y:ShapeNode>\
+          <y:Geometry height="20.0" width="45"/>\
+          <y:NodeLabel alignment="center" fontFamily="Dialog" fontSize="9">{0}</y:NodeLabel>\
+        </y:ShapeNode>\
+      </data>
+
+edge=<data key="d6">\
+        <y:PolyLineEdge>\
+          <y:Arrows source="none" target="standard"/>\
+        </y:PolyLineEdge>\
+      </data>
+      

src/tbrugz/xml/AbstractDump.java

 import java.io.FileInputStream;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.PrintStream;
 import java.util.Properties;
 import java.util.regex.Matcher;
 		}
 		catch(IOException ioe) {
 			try {
-				prop.load(AbstractDump.class.getResourceAsStream("/"+fileName));
-				log.info("loaded prop resource: "+fileName);
+				String resource = "/"+fileName;
+				InputStream is = AbstractDump.class.getResourceAsStream(resource);
+				if(is==null) { log.warn("resource not found: "+resource); return; }
+				prop.load(is);
+				log.info("loaded prop resource: "+resource);
 			}
 			catch(IOException e) {
 				log.warn("error loading file: "+ioe);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.