Uploaded image for project: 'ShrinkWrap'
  1. ShrinkWrap
  2. SHRINKWRAP-348

Deleting a directory specified by a File with a trailing slash does not work

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 1.0.0-cr-2
    • Fix Version/s: 1.1.0-alpha-1
    • Component/s: None
    • Labels:
      None

      Description

      We have a directory gwtutil with 10+ classes in there, which we want to delete from the archive

      This does nothing, it does not even fail-fast:

      webArchive.delete(ArchivePaths.create("WEB-INF/classes/org/drools/guvnor/gwtutil/"));
      

      This does work:

      webArchive.delete(ArchivePaths.create("WEB-INF/classes/org/drools/guvnor/gwtutil"));
      

      The difference is the absence of the trailing /.

      Using arquillian bom CR5

        Gliffy Diagrams

          Activity

          Hide
          tommysdk Tommy Tynjä added a comment -

          Paths wihtin archives are represented without the trailing slash, so the above mentioned behaviour makes sense since the gwtutil path is represented within the archive as "WEB-INF/classes/org/drools/guvnor/gwtutil" (without a trailing slash). That's why the second operation works, while the first path won't match the path within the archive.

          It would be nice though if the first operation (path with trailing slash) would match the path within the archive which has no trailing slash.

          While writing a test case to reproduce/test this behaviour I found a bug in the Archive.contains method, where deleted paths can still be indicated as present in the archive, when they infact are not.

          I'm working on a solution for both the handling of a possible trailing slash in the path, as it would be a nice feature, as well as fixing the bug in the contains-method.

          Show
          tommysdk Tommy Tynjä added a comment - Paths wihtin archives are represented without the trailing slash, so the above mentioned behaviour makes sense since the gwtutil path is represented within the archive as "WEB-INF/classes/org/drools/guvnor/gwtutil" (without a trailing slash). That's why the second operation works, while the first path won't match the path within the archive. It would be nice though if the first operation (path with trailing slash) would match the path within the archive which has no trailing slash. While writing a test case to reproduce/test this behaviour I found a bug in the Archive.contains method, where deleted paths can still be indicated as present in the archive, when they infact are not. I'm working on a solution for both the handling of a possible trailing slash in the path, as it would be a nice feature, as well as fixing the bug in the contains-method.
          Hide
          tommysdk Tommy Tynjä added a comment -

          Pushed fix to fork: https://github.com/tommysdk/shrinkwrap/compare/SHRINKWRAP-348

          Added two reproducing test cases which also discovered the suspicious behaviour in Archive.contains. Added support for removing paths with trailing slash.

          Show
          tommysdk Tommy Tynjä added a comment - Pushed fix to fork: https://github.com/tommysdk/shrinkwrap/compare/SHRINKWRAP-348 Added two reproducing test cases which also discovered the suspicious behaviour in Archive.contains. Added support for removing paths with trailing slash.
          Show
          alrubinger Andrew Rubinger added a comment - Upstream: https://github.com/shrinkwrap/shrinkwrap/commit/2e7e2a234876fabccab348a6cf1184ba517d4cd7

            People

            • Assignee:
              tommysdk Tommy Tynjä
              Reporter:
              ge0ffrey Geoffrey De Smet
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development