Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2008, 05:19 PM
Member
 
Join Date: Feb 2008
Posts: 1
borgrodrick is on a distinguished road
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!!!
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-13-2008, 01:03 AM
Member
 
Join Date: Feb 2008
Posts: 3
taicode is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to get class name & path sandor New To Java 4 08-12-2008 03:38 PM
Log4J.jar in class path eva New To Java 0 01-02-2008 08:39 PM
Setting Java Path bugger New To Java 2 11-22-2007 11:48 AM
problem with PATH creativehacker New To Java 4 07-11-2007 04:54 PM
Specifying absolute path in web.xml Felissa JavaServer Pages (JSP) and JSTL 1 07-05-2007 08:56 AM


All times are GMT +3. The time now is 01:33 PM.


VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org