Bug 29711 - Utility methods to interconvert between File and URL
Utility methods to interconvert between File and URL
Status: CLOSED FIXED
Product: platform
Classification: Unclassified
Component: -- Other --
3.x
All All
: P2 (vote)
: 3.x
Assigned To: Jesse Glick
issues@platform
http://developer.java.sun.com/develop...
: API, JDK_SPECIFIC, SPACE_IN_PATH
Depends on:
Blocks: 27330
  Show dependency treegraph
 
Reported: 2002-12-24 15:06 UTC by Jesse Glick
Modified: 2011-06-09 09:51 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2002-12-24 15:06:01 UTC
There seem to be many places in the core codebase
where a File is converted to a URL or vice-versa.

In JDK 1.3, there is no great way to do this. You
can use File.toURL, but this does a poor job
escaping some characters such as '#'. The reverse
direction is harder; URL.getFile is a cheap trick
but generally works.

In JDK 1.4, there is a supported API involving the
new URI class.

There should be one code path that uses the better
style under 1.4 and the workarounds under 1.3,
with a unit test.
Comment 1 Jesse Glick 2002-12-24 17:20:15 UTC
See the URL above for an explanation of why the JDK 1.3 methods do not
suffice.
Comment 2 Jesse Glick 2002-12-24 17:20:39 UTC
Also for Ant:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8031
Comment 3 Jesse Glick 2002-12-24 21:32:07 UTC
committed   * Up-To-Date  1.91        openide/openide-spec-vers.properties
committed   * Up-To-Date  1.123      
openide/api/doc/changes/apichanges.xml
added       * Up-To-Date  1.1        
openide/src/org/openide/util/FileURLConvertor14.java
committed   * Up-To-Date  1.116      
openide/src/org/openide/util/Utilities.java
added       * Up-To-Date  1.1        
openide/test/unit/src/org/openide/util/UtilitiesFileURLConvertorTest.java
Comment 4 Marian Mirilovic 2011-06-09 09:51:06 UTC
v/c


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo