Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Question about: new URLDecoder().decode( Class.getResource().getFile() )

Reply
Thread Tools

Question about: new URLDecoder().decode( Class.getResource().getFile() )

 
 
opalpa@gmail.com
Guest
Posts: n/a
 
      12-21-2004

I got an executable file that is a resource of a java class. This
executable gets run using Runtime.getRuntime().exec which needs a
String path

To get my String path for exec I first get the URL of the executable
using getResource() . URL has a getFile method which returns a String.
This String is not the right one for exec because it is URL encoded
with sequences like %20 and %25.

Not much trouble, just use URLDecoder to get at the String.

Here is the question:
Does getResource() return a URL in a particular encoding?
Alternatively I can see getResource() return a platform specific
encoding in which case I want URLDecoder.decode(String) which is
deprecated because it uses platform specifc encodings.

Cheers

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript new-new-new-new-newbee weblinkunlimited@gmail.com Javascript 2 03-11-2008 01:15 AM
2008 new year,2008 new business, 2008 new life, much cheap andbeautiful product will help you yhnetstore@gmail.com Digital Photography 0 01-07-2008 04:57 PM
A new hard drive question: move files to new HD Jer Computer Support 4 12-01-2005 09:10 AM
New computer, New OS, New Wireless Problem :-\ =?Utf-8?B?RGFu?= Wireless Networking 3 07-31-2005 02:11 PM
overloaded global operator new/new[] and corresponding deletes question Dodo C++ 1 08-26-2003 01:59 PM



Advertisments