The moose likes I/O and Streams and the fly likes What's the purpose of File.getAbsoluteFile() method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "What Watch "What New topic
Author

What's the purpose of File.getAbsoluteFile() method?

Karthikeyan Pandian
Ranch Hand

Joined: Jun 09, 2013
Posts: 66
Dear all

can any one explain me the purpose of getABsoluteFile()
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17142
    
  27

I'm not sure what "getABsoultefile()" is supposed to mean, but the java.io.File getAbsolutePath() method returns a string that corresponds to the absolute path of the File object. That is, the entire directory path all the way down from the filesystem root. I highly recommend it when there's likely to be doubt about what the current directory might might be, since the relative path might be confusing.

There's also something known as the "canonical path", which is simply the "official" absolute path. There can potentially be more than one absolute path to a file, especially on systems that allow soft-linked (alias) file paths. The canonical path is the one that is most direct.


An IDE is no substitute for an Intelligent Developer.
Karthikeyan Pandian
Ranch Hand

Joined: Jun 09, 2013
Posts: 66
Thank you buddy for your explanation.....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's the purpose of File.getAbsoluteFile() method?
 
It's not a secret anymore!