Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-48405

Use NIO in Util.deleteFile for better error messages

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      Switching to NIO will improve the error messages when a file cannot be deleted, and will allow us to remove some JNR and Ant Chmod usages in Util#makeWritable.

      This should affect all of the recursive deletion methods in hudson.model.FilePath and hudson.model.Util as they all eventually call Util#deleteFile.

          [JENKINS-48405] Use NIO in Util.deleteFile for better error messages

          Code changed in jenkins
          User: Devin Nusbaum
          Path:
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/1270ba3b40ade4b822ee7538e31f0692ffbf64d2
          Log:
          JENKINS-48405 Use NIO in tryOnceDeleteFile and makeWritable (#3169)

          • Use NIO in tryOnceDeleteFile and makeWritable
          • Don't try to set PosixFileAttributes on Windows
          • Do not create arbitrary exceptions in makeWritable to fix test failures on Windows
          • Remove unhelpful layer of exception wrapping
          • Add test exercising Util#makeWritable in Util#tryOnceDeleteFile
          • Add test for deleting a non-existant file
          • Return early if changing permissions with NIO succeeds

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Devin Nusbaum Path: core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/1270ba3b40ade4b822ee7538e31f0692ffbf64d2 Log: JENKINS-48405 Use NIO in tryOnceDeleteFile and makeWritable (#3169) Use NIO in tryOnceDeleteFile and makeWritable Don't try to set PosixFileAttributes on Windows Do not create arbitrary exceptions in makeWritable to fix test failures on Windows Remove unhelpful layer of exception wrapping Add test exercising Util#makeWritable in Util#tryOnceDeleteFile Add test for deleting a non-existant file Return early if changing permissions with NIO succeeds

          Daniel Beck added a comment -

          Fixed towards 2.96.

          Daniel Beck added a comment - Fixed towards 2.96.

            dnusbaum Devin Nusbaum
            dnusbaum Devin Nusbaum
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: