![]() |
The Java Developers Almanac 1.4 |
|
e15. Getting an Absolute Filename Path from a Relative Filename Path File file = new File("filename.txt");
file = file.getAbsoluteFile(); // c:\temp\filename.txt
file = new File("dir"+File.separatorChar+"filename.txt");
file = file.getAbsoluteFile(); // c:\temp\dir\filename.txt
file = new File(".."+File.separatorChar+"filename.txt");
file = file.getAbsoluteFile(); // c:\temp\..\filename.txt
// Note that filename.txt does not need to exist
e14. Converting Between a Filename Path and a URL e16. Determining If Two Filename Paths Refer to the Same File e17. Getting the Parents of a Filename Path e18. Determining If a Filename Path Is a File or a Directory
© 2002 Addison-Wesley. |