Commons IO
  1. Commons IO
  2. IO-163

FileUtils.toURLs() uses deprecated (and bad) method of conversion to URL

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 2.0
    • Component/s: Utilities
    • Labels:
      None

      Description

      The method FileUtils.toURLs() uses the following method to convert from File to URL:
      File.toURL();

      This method has scary warnings that it's a bad way to do the conversion because characters will not be escaped as required in URL strings. In Java 1.6, this method has actually been deprecated. All recent JDK versions recommend instead using:
      File.toURI().toURL();

      as the URI code will properly perform the escaping.

        Activity

        Show
        Niall Pemberton added a comment - Fixed thanks http://svn.apache.org/viewvc?view=rev&revision=647000

          People

          • Assignee:
            Niall Pemberton
            Reporter:
            Alex Miller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development