GeeCON Prague 2014*
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


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: 16103
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Karthikeyan Pandian
Ranch Hand

Joined: Jun 09, 2013
Posts: 66
Thank you buddy for your explanation.....
 
GeeCON Prague 2014
 
subject: What's the purpose of File.getAbsoluteFile() method?