When I execute the following code:
File f = getFile(); String absPath = f.getAbsolutePath() System.out.println(absPath); I get the following print out:
C:\Users\myUser\Desktop\test\file.txt
But that's not what I want! I want the absolute path leading up to file.txt, i.e.:
C:\Users\myUser\Desktop\test\
I'm trying to figure out how to use the Java File I/O API to accomplish this but I can't seem to find anything that is a match for what I'm looking for. Thanks for any nudges in the right direction.