aspose file tools*
The moose likes Beginning Java and the fly likes how to get file path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how to get file path" Watch "how to get file path" New topic
Author

how to get file path

Jherald Lacambra
Ranch Hand

Joined: Feb 02, 2005
Posts: 129
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?


jherald
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Where is the text file?


[Jess in Action][AskingGoodQuestions]
Jherald Lacambra
Ranch Hand

Joined: Feb 02, 2005
Posts: 129
outside the directory of the class dile that calls the text file
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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?


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
wood burning stoves
 
subject: how to get file path