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,
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
posted
0
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
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
timothy zimmerman
Ranch Hand
Joined: Jun 26, 2001
Posts: 149
posted
0
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")
Eugene Armistead
Greenhorn
Joined: Jul 12, 2001
Posts: 10
posted
0
Thanks for the tips. They work just fine!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.