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

NumberFormatException from FileUtils.toFile method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.4
    • None
    • Utilities
    • None

    Description

      Certain strings can cause the org.apache.commons.io.FileUtils.toFile(URL url) method to call Integer.parseInt with an invalid argument and thus throw a NumberFormatException:

      Exception in thread "main" java.lang.NumberFormatException: For input string: "%2"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      at java.lang.Integer.parseInt(Integer.java:449)
      at org.apache.commons.io.FileUtils.toFile(FileUtils.java:476)

      One example of such a string: "both%20are%20100%20%25%20true"

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              valrith Valrith
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified