Java eclipse referencing files in project using relative paths -


i trying upload web using 1 of apache's client libraries. having trouble locating resource file upload. project setup looks this:

root/src/a/b/c/d/program.java

root/resource/resourcefile.txt

i wondering string path referencing resource file program.java?

file f = new file("what path go here?");

thanks in advance.

  • eclipse (by default) not include file in built project.
  • the project path information eclipse environment not available in built project

if run in eclipse, display base path of application.

find out with

file f = new file("."); system.out.println(f.getabsolutepath()); 

tips :

  1. read documentation of java api
  2. for questions write minmal test programs

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -