Hello!
I have a webapp running in my local tomcat. The path is: tomcat/webapps/myproject
.
I have some resources in this project all in a folder with this path: tomcat/webapps/myproject/resources
So, I am trying to acces to this resources from a java project, using a file config.properties
. In this file I have something like this:
tomcat.url= http://localhost
tomcat.port=8080
tomcat.resources=/myproject/resources
I tryed also different combinations of /
or \
but I get this error runing my project:
Trying to acces to a directory that does not exist
My java code:
Configuration config = new PropertiesConfiguration("config.properties");
String sourcePath = config.getString("tomcat.resources");
//And I try to list this folder
File dir = new File(sourcePath);
String[] children = dir.list();
if (children == null) {
// Either dir does not exist or is not a directory
throw new ServiceExecutionException("Trying to generate Metadata in a directory that does not exist");
}
I don't know what is wrong, in projects I made before, simliar to this, I had something similar and it found everything.
Any ideas?? Thanks in advance