Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get file path
 
Similar Threads
How to get the path of an Uploaded file?
How to get the complete file path in Mozila
Create file object for each assets item.
Servlet Path/Path Info what for ?
jar and path