Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16716

Replace commons-io usages with pure Java

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • main (10.0), 9.3
    • None
    • None

    Description

      Replaces commons-io with JDK methods where possible. Adds the following forbiddenapi rules.

      @defaultMessage Use java.nio.file.Files#copy(java.nio.file.Path, java.nio.file.Path) instead
      org.apache.commons.io.FileUtils#copyFile(java.io.File, java.io.File)
      
      @defaultMessage Use Files.readString instead
      org.apache.commons.io.FileUtils#readFileToString(**)
      
      @defaultMessage Use OutputStream.nullOutputStream() instead
      org.apache.commons.io.output.NullPrintStream
      
      @defaultMessage Use org.apache.solr.common.util.IOUtils.closeQuietly or try-with-resources
      org.apache.commons.io.IOUtils#closeQuietly(**)
      
      @defaultMessage Use new String(inputstream.readAllBytes(), StandardCharsets.UTF_8)
      org.apache.commons.io.IOUtils#toString(java.io.InputStream, java.lang.String)
      
      @defaultMessage Use readAllBytes() method on InputStream
      org.apache.commons.io.IOUtils#toByteArray(java.io.InputStream)
      org.apache.commons.io.IOUtils#toByteArray(java.net.URL)
      

      This makes commons-io a test only dependency for analysis-extras and removes commons-io from jwt-auth and extraction.

      Attachments

        Activity

          People

            krisden Kevin Risden
            krisden Kevin Risden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 10m
                2h 10m