Results 1 to 2 of 2
Thread: Specify path
- 02-09-2008, 04:19 PM #1
Member
- Join Date
- Feb 2008
- Posts
- 1
- Rep Power
- 0
Specify path
I have an assignment and was given a code which I must add to it. In it there is specified a path which I have to reference it to a path on my C: (a .txt file). The part is somthing like this:
"GenerateContainers gc = new GenerateContainers(path);"
I need to reference the path to a .txt file in the C drive.
I`m dooing somthing like this but I`m getting an error
path = c:/terminal.txt
Can Someone please help!!!
- 02-13-2008, 12:03 AM #2
Member
- Join Date
- Feb 2008
- Posts
- 3
- Rep Power
- 0
I'm trying to take a shot at this. I'm very new to Java, so pardon me if my suggestion is not the best solution.
In the GenerateContainers(path) constructor, the path type is IPath, or rather an interface, that may be why it's not taking your path as a type String as you indicated with path = c:/terminal.txt. Building a path first may be necessary to return an IPath type path with the fromOSString(String pathString) method call, which need to import "org.eclipse.core.runtime.Path". Please give this a try:
GenerateContainers gc = new GenerateContainers( fromOSString( "c:/terminal.txt" ) );
I still trying to figure out how to install eclipse, so I can't yet test the above suggestion.
Similar Threads
-
trying to get class name & path
By sandor in forum New To JavaReplies: 4Last Post: 08-12-2008, 02:38 PM -
Log4J.jar in class path
By eva in forum New To JavaReplies: 0Last Post: 01-02-2008, 07:39 PM -
Setting Java Path
By bugger in forum New To JavaReplies: 2Last Post: 11-22-2007, 10:48 AM -
problem with PATH
By creativehacker in forum New To JavaReplies: 4Last Post: 07-11-2007, 03:54 PM -
Specifying absolute path in web.xml
By Felissa in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 07-05-2007, 07:56 AM
Bookmarks