add the ability to detect a symlink in a tar file
-------------------------------------------------
Key: COMPRESS-122
URL: https://issues.apache.org/jira/browse/COMPRESS-122
Project: Commons Compress
Issue Type: New Feature
Components: Archivers
Affects Versions: 1.1
Environment: all
Reporter: Max Birkoff
Fix For: 1.2
It is not currently posible to determine if an entry in a tar archive denotes a
symbolic link or not; the only existing query mechanism is: isDirectory()
I propose to add the following patch to:
commons-compress-1.1-src/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
Thanks much in advance,
--- TarArchiveEntry.java.0 2010-10-27 13:30:58.669839000 -0700
+++ TarArchiveEntry.java 2010-10-27 13:54:48.344231000 -0700
@@ -594,6 +594,15 @@
}
/**
+ * Return whether or not this entry represents a symbolic link.
+ *
+ * @return True if this entry represents a symbolic link, false otherwise.
+ */
+ public boolean isSymbolicLink() {
+ return (linkFlag == LF_SYMLINK);
+ }
+
+ /**
* If this entry represents a file, and the file is a directory, return
* an array of TarEntries for this entry's children.
*
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.