-
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!!!
-
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.