File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/java/de/doubleslash/keeptime/common Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 1313import java .io .IOException ;
1414import java .io .InputStream ;
1515
16+ /**
17+ * class loads SvgPath from a SvgFile because Java can not load the original svg file as it is. <p>
18+ * To load the svg the class extracts the path as string and creates a new SvgPath and returns it.
19+ */
20+
1621public class SvgNodeProvider {
1722
1823 private static String getSvgPathWithXMl (Resources .RESOURCE resource ) {
1924 String svgPath ;
2025 Document document ;
2126 DocumentBuilderFactory dbf = DocumentBuilderFactory .newInstance ();
22- DocumentBuilder db = null ;
23-
27+ DocumentBuilder db ;
2428
2529 try {
2630 db = dbf .newDocumentBuilder ();
2731 } catch (ParserConfigurationException e ) {
28- throw new RuntimeException (e );
32+ throw new RuntimeException (e + "Tried to build new document" );
2933 }
3034
3135 try (InputStream inputStream = Resources .getResource (resource ).openStream ()) {
3236 document = db .parse (inputStream );
3337 NodeList nodeList = document .getElementsByTagName ("path" );
3438 svgPath = nodeList .item (0 ).getAttributes ().getNamedItem ("d" ).getNodeValue ();
3539 } catch (IOException | SAXException e ) {
36- throw new RuntimeException (e );
40+ throw new RuntimeException (e + " " );
3741 }
3842 return svgPath ;
3943 }
You can’t perform that action at this time.
0 commit comments