Hi, Can anyone tell me if there is an easy way to convert a String object that represents a path to a File object? I have a method that accepts a File object as an argument, but I have a String that that is the path to that file, i.e. "c:\MyProgs\data.txt" and I'd like to pass a reference to the File "data.txt" Thanks,
Joined: Nov 06, 2000
There is a file constructor that you can use. do this... File f = new File("c:\MyProgs\", "data.txt" ); Then send f to your method... Check the API to verify this.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Joined: Jun 26, 2001
There is also a File constructor which takes a single String representing teh lcoation of the file File f = new File( "C:\MyProgs\data.txt")