I would like to use to read properties file from out side of the my web application. I was deployed a war file in tomcat in windows environment and I am able to read properties file from outside of my web application using following code.
//(Method 1.)
String filePath =
new java.io.File( ".").getCanonicalPath()+"/webapps/strsproperties/strs.properties";
// or
//(Method 2.)
String filePath = new File(System.getProperty("catalina.base"))+ "/webapps/strsproperties/strs.properties";
InputStream inputStream = null;
inputStream = new FileInputStream(filePath);
properties.load(inputStream);
String application = properties.getProperty("applications");
In above both case's I am able to read filePath in windows.
Problem is I am not able to read filePath in Linux using 1st method ( relative path) process.
Is there any way to read file using relative path in tomcat from Linux env ?.