File file = new File("filename.txt");
file = file.getAbsoluteFile();  // c:tempfilename.txt

file = new File("dir"+File.separatorChar+"filename.txt");
file = file.getAbsoluteFile();  // c:tempdirfilename.txt

file = new File(".."+File.separatorChar+"filename.txt");
file = file.getAbsoluteFile();  // c:temp..filename.txt

// Note that filename.txt does not need to exist

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.