Uploaded image for project: 'Commons Compress'
  1. Commons Compress
  2. COMPRESS-328

TarArchiveEntry preserveLeadingSlashes has no effect on setName

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11
    • Component/s: None
    • Labels:
      None

      Description

      We've run into an inconsistency with the TarArchiveEntry at jdeb.

      https://github.com/tcurdt/jdeb/issues/217

      You can create a `TarArchiveEntry(String name, boolean preserveLeadingSlashes)` but the `preserveLeadingSlashes` is only applied in the constructor.

      https://github.com/apache/commons-compress/blob/master/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java#L392

      I am proposing to turn `preserveLeadingSlashes` into a read-only property and use the value on `setName()`, too (instead of just false).

      This has some implications and maybe some backwards compatibility issues - but even then I think it would be the right thing to do.

      I am happy to make the change but thought to discuss this first.

        Attachments

          Activity

            People

            • Assignee:
              tcurdt Torsten Curdt
              Reporter:
              tcurdt Torsten Curdt
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: