[jira] Created: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

View: New views
7 Messages — Rating Filter:   Alert me  

[jira] Created: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Improve URL decoding done by FileUtils.toFile()
-----------------------------------------------

                 Key: PLXUTILS-56
                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
             Project: Plexus Utils
          Issue Type: Bug
            Reporter: Benjamin Bentmann
         Attachments: file-utils.patch

A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.

The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.

The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


[jira] Updated: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/PLXUTILS-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated PLXUTILS-56:
--------------------------------------

    Attachment: file-utils.patch

Made patch compile against Java 1.4

> Improve URL decoding done by FileUtils.toFile()
> -----------------------------------------------
>
>                 Key: PLXUTILS-56
>                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
>             Project: Plexus Utils
>          Issue Type: Bug
>            Reporter: Benjamin Bentmann
>         Attachments: file-utils.patch, file-utils.patch
>
>
> A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.
> The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.
> The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/PLXUTILS-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated PLXUTILS-56:
--------------------------------------

    Attachment:     (was: file-utils.patch)

> Improve URL decoding done by FileUtils.toFile()
> -----------------------------------------------
>
>                 Key: PLXUTILS-56
>                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
>             Project: Plexus Utils
>          Issue Type: Bug
>            Reporter: Benjamin Bentmann
>
> A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.
> The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.
> The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/PLXUTILS-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated PLXUTILS-56:
--------------------------------------

    Attachment:     (was: file-utils.patch)

> Improve URL decoding done by FileUtils.toFile()
> -----------------------------------------------
>
>                 Key: PLXUTILS-56
>                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
>             Project: Plexus Utils
>          Issue Type: Bug
>            Reporter: Benjamin Bentmann
>
> A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.
> The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.
> The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/PLXUTILS-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated PLXUTILS-56:
--------------------------------------

    Attachment: url-to-file.patch

Next try: Copied code from Commons IO 1.4. I included an index fix such that "%2520" properly decodes to "%20" rather than " ".

> Improve URL decoding done by FileUtils.toFile()
> -----------------------------------------------
>
>                 Key: PLXUTILS-56
>                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
>             Project: Plexus Utils
>          Issue Type: Bug
>            Reporter: Benjamin Bentmann
>         Attachments: url-to-file.patch
>
>
> A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.
> The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.
> The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Updated: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/PLXUTILS-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann updated PLXUTILS-56:
--------------------------------------

    Affects Version/s: 1.0.4

> Improve URL decoding done by FileUtils.toFile()
> -----------------------------------------------
>
>                 Key: PLXUTILS-56
>                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
>             Project: Plexus Utils
>          Issue Type: Bug
>    Affects Versions: 1.0.4
>            Reporter: Benjamin Bentmann
>         Attachments: url-to-file.patch
>
>
> A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.
> The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.
> The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



[jira] Closed: (PLXUTILS-56) Improve URL decoding done by FileUtils.toFile()

by JIRA jira@codehaus.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ http://jira.codehaus.org/browse/PLXUTILS-56?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed PLXUTILS-56.
-------------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 1.5.2

Fixed in [r7278|http://fisheye.codehaus.org/changelog/plexus/?cs=7278].

> Improve URL decoding done by FileUtils.toFile()
> -----------------------------------------------
>
>                 Key: PLXUTILS-56
>                 URL: http://jira.codehaus.org/browse/PLXUTILS-56
>             Project: Plexus Utils
>          Issue Type: Bug
>    Affects Versions: 1.0.4
>            Reporter: Benjamin Bentmann
>            Assignee: Benjamin Bentmann
>             Fix For: 1.5.2
>
>         Attachments: url-to-file.patch
>
>
> A URL like "file:/C:/name%20with%20encoded%20spaces.txt" currently fails to get properly converted to the file path "C:\name with spaces.txt". The problem stems from URL.getFile() returning a raw (i.e. still URL-encoded) substring, see [Sun Bug ID 4466485|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4466485] for a vivid discussion.
> The attached patch is not perfect, i.e. may still fail for certain URLs as it only decodes selected escape sequences. In the long term, the method should be updated to use java.io.File.<ctor>(java.net.URI) which does the proper decoding.
> The patch includes some minor tweaks to the class which are not related to this issue but I could not resist.

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

       

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email