[OS-JIRA] Created: (WOL-1079) URLUtils.cheatAndTurnIntoFile(URL url) doesn't handle URLs which are not encoded. This breaks reverse engineering.

From: Mark Ritchie (JIRA) ("Mark)
Date: Wed Sep 09 2009 - 00:36:59 EDT

  • Next message: Mike Schrag: "Re: info for eclipse install of WOLips?"

    URLUtils.cheatAndTurnIntoFile(URL url) doesn't handle URLs which are not encoded. This breaks reverse engineering.
    -------------------------------------------------------------------------------------------------------------------

                     Key: WOL-1079
                     URL: http://issues.objectstyle.org/jira/browse/WOL-1079
                 Project: WOProject/WOLips
              Issue Type: Improvement
        Affects Versions: WOLips 3.3.* Next Stable Build
             Environment: OSX 10.5.7, java 1.5, Eclipse 3.4.2, WOLips top of tree.
                Reporter: Mark Ritchie

    Mike's code to fix this is in this patch:

    Index: wolips/base/plugins/org.objectstyle.wolips.baseforplugins/java/org/objectstyle/wolips/baseforplugins/util/URLUtils.java
    ===================================================================
    --- wolips/base/plugins/org.objectstyle.wolips.baseforplugins/java/org/objectstyle/wolips/baseforplugins/util/URLUtils.java (revision 5973)
    +++ wolips/base/plugins/org.objectstyle.wolips.baseforplugins/java/org/objectstyle/wolips/baseforplugins/util/URLUtils.java (working copy)
    ..-182,8 +182,11 @@
                             else if ("file".equals(protocol)) {
                                     try {
                                             String externalForm = url.getPath();
    - externalForm = URLDecoder.decode(externalForm, "UTF-8");
                                             f = new File(externalForm);
    + if (!f.exists()) {
    + externalForm = URLDecoder.decode(externalForm, "UTF-8");
    + f = new File(externalForm);
    + }
                                     } catch (IOException e) {
                                             throw new IllegalArgumentException(url + " cannot be turned into a File.", e);
                                     }

    -- 
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://issues.objectstyle.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira
    



    This archive was generated by hypermail 2.0.0 : Wed Sep 09 2009 - 00:37:40 EDT