Bounty: 50
I have a Spring Boot v2.1.2.RELEASE application.
I have a file in ../src/main/resources/icons/128/black/ae.png
which I want to read, But I got an error: Unable to make sense of URL for connection
@SpringBootApplication
public class SvgManagerApplication implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication.run(SvgManagerApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
try {
String parser = XMLResourceDescriptor.getXMLParserClassName();
SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser);
Document doc = f.createDocument("classpath:icons/128/black/ae.svg");
System.out.println(doc);
} catch (IOException ex) {
System.out.println(ex.getMessage());
}
}
}