ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49744] New: new org.apache.tools.tar.TarEntry("/").isDirectory() returns false
Date Thu, 12 Aug 2010 12:54:17 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49744

           Summary: new org.apache.tools.tar.TarEntry("/").isDirectory()
                    returns false
           Product: Ant
           Version: 1.8.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: christian@schlichtherle.de


This is a regression since Ant 1.7.1.

In Ant 1.8.1, the constructor public TarEntry(String name) and others call the
method normalizeFileName in order to (you guessed it) normalize the file name.
However, this method normalizes "/" into "". As a consequence, the method
isDirectory() returns false for this entry.

Rationale: A TarEntry with the name "/" is created by TrueZIP 6.7
(https://truezip.dev.java.net) as a virtual root directory. This TarEntry is
actually never written to the TAR file, but solely used in order to associate
meta data with the TAR file itself. Later on, the last modification time of
this virtual root directory is used to post-fix the last modification time of
the TAR file itself.

Work-around: Call the newly introduced constructor public TarEntry(String name,
boolean preserveLeadingSlashes) with true as its boolean parameter.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message