Reputation: 189
I am trying to upload something to the web using one of Apache's client libraries. However I am having trouble locating the resource file to upload. My project setup looks like this:
Root/src/a/b/c/d/program.java
Root/resource/resourceFile.txt
I was wondering what the string path would be for referencing that resource file from program.java?
File f = new File("what path would go here?");
Thanks in advance.
Upvotes: 1
Views: 4048
Reputation: 1135
If you run this in Eclipse, it will display the base path of your application.
Find out with
File f = new File(".");
System.out.println(f.getAbsolutePath());
Tips :
Upvotes: 1