This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes path to load a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "path to load a file" Watch "path to load a file" New topic

path to load a file

vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
I have a properties file inside the following folder structure


I have to load this properties file from which is in the following folder structure....


how do I do this ?
Harish Kashyap
Ranch Hand

Joined: Jun 14, 2000
Posts: 118
Properties properties = new Properties();
try {
properties.load(new FileInputStream("/project/folder1/"));
} catch (IOException e) {

you must use the absolute path or the relative path of the properties file.
remember, if you are executing p1.p2.A.class then your class could be in c:\p1\p2 folder, but you will be executing it from c:\ so the path of the properties file should be either absolute path or relative path to c:\
It is sorta covered in the JavaRanch Style Guide.
subject: path to load a file
Similar Threads
how to retieve the keys and values from a propertyfile in an order
path to load a file
How to access properties file from WEB-INF/ directory
location for for my EAR Application
file path