Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

java URL help plz

Thread view: 
morc - 07 Feb 2006 15:11 GMT
hey i used this code for testing:

URL url = modelsData.class.getResource(user+".dat");
String path = url.getPath();

now the thing is a changed the folder in which i need the url to point
too. its no longer in the same folder as the modelsData class. My
question is how can i put the path ihave into a URL?? I need to make
the url poitn to :

"C:/tomcat/webapps/export/ModelUsers/"+user+".dat";

but i can't figure out how to construct the URL in javadoc.
Thanks for any help
-morc
oulan bator - 07 Feb 2006 16:10 GMT
you can make
new File("C:/tomcat/webapps/export/ModelUsers/"+user+".dat").toURI()
or toURL()

regards
morc - 07 Feb 2006 17:01 GMT
thanks exactly what i needed.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.