The project if built with Spring and has the standard filesystem of Maven.
Assume we want to read foo.txt in WEB-INF/classes/resources/foo.txt
ClassPathResource r = new ClassPathResource("foo.xml");
try {
System.out.println("full path"+r.getFile().getAbsolutePath());
} catch (IOException e1) {
e1.printStackTrace();
}
The output is the full path to foo.xml.
No comments:
Post a Comment