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

Use NIO in Util.deleteFile for better error messages

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            Hide
            scm_issue_link 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
            Show
            scm_issue_link 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
            Hide
            danielbeck Daniel Beck added a comment -

            Fixed towards 2.96.

            Show
            danielbeck Daniel Beck added a comment - Fixed towards 2.96.

              People

              • Assignee:
                dnusbaum Devin Nusbaum
                Reporter:
                dnusbaum Devin Nusbaum
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: