Author: sebb
Date: Mon May 10 01:43:08 2010
New Revision: 942641

URL: http://svn.apache.org/viewvc?rev=942641&view=rev
Log:
Fix Pax header checks

Modified:
    
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
    
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java

Modified: 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: 
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=942641&r1=942640&r2=942641&view=diff
==============================================================================
--- 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 (original)
+++ 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
 Mon May 10 01:43:08 2010
@@ -542,7 +542,17 @@ public class TarArchiveEntry implements 
      * @return <code>true</code> if this is a Pax header.
      */
     public boolean isPaxHeader(){
-        return linkFlag == LF_PAX_EXTENDED_HEADER || linkFlag == 
LF_PAX_GLOBAL_EXTENDED_HEADER;
+        return linkFlag == LF_PAX_EXTENDED_HEADER_LC
+            || linkFlag == LF_PAX_EXTENDED_HEADER_UC;
+    }
+
+    /**
+     * Check if this is a Pax header.
+     * 
+     * @return <code>true</code> if this is a Pax header.
+     */
+    public boolean isGlobalPaxHeader(){
+        return linkFlag == LF_PAX_GLOBAL_EXTENDED_HEADER;
     }
 
     /**

Modified: 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java
URL: 
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java?rev=942641&r1=942640&r2=942641&view=diff
==============================================================================
--- 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java
 (original)
+++ 
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java
 Mon May 10 01:43:08 2010
@@ -156,7 +156,8 @@ public interface TarConstants {
     /**
      * Identifies the entry as a Pax extended header.
      */
-    byte LF_PAX_EXTENDED_HEADER = (byte) 'x';
+    byte LF_PAX_EXTENDED_HEADER_LC = (byte) 'x'; //
+    byte LF_PAX_EXTENDED_HEADER_UC = (byte) 'X'; // SunOS tar -E
     
     /**
      * Identifies the entry as a Pax global extended header.


Reply via email to