• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get file path

 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i use the System.getProperty("user.dir") i get the current working directory.. i want to get the absolute file path of a text file... how can this be done?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is the text file?
 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
outside the directory of the class dile that calls the text file
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the File class. You'll find several methods that give you different forms of paths. The doc is a bit confusing, so try some of them and see what they mean.


Does that answer the right question?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic