Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-163

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.4
    • 2.0
    • Utilities
    • 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.

      Attachments

        Activity

          People

            niallp Niall Pemberton
            puredanger Alex Miller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: