Repository: commons-compress Updated Branches: refs/heads/master 34a1f829c -> beb43a555
make construction of tar entry names more explicit Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/beb43a55 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/beb43a55 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/beb43a55 Branch: refs/heads/master Commit: beb43a5558593bf6afa39295124777373781dc13 Parents: 34a1f82 Author: Stefan Bodewig <[email protected]> Authored: Sun Jan 21 16:54:57 2018 +0100 Committer: Stefan Bodewig <[email protected]> Committed: Sun Jan 21 16:54:57 2018 +0100 ---------------------------------------------------------------------- .../compress/archivers/tar/TarArchiveEntry.java | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/beb43a55/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java index ffced21..cf93feb 100644 --- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java +++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java @@ -242,6 +242,9 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants { * Construct an entry with only a name. This allows the programmer * to construct the entry's header "by hand". File is set to null. * + * <p>The entry's name will be the value of the {@code name} + * argument with leading slashes stripped.</p> + * * @param name the entry name */ public TarArchiveEntry(final String name) { @@ -252,6 +255,10 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants { * Construct an entry with only a name. This allows the programmer * to construct the entry's header "by hand". File is set to null. * + * <p>The entry's name will be the value of the {@code name} + * argument with leading slashes stripped if {@code + * preserveLeadingSlashes} is {@code false}.</p> + * * @param name the entry name * @param preserveLeadingSlashes whether to allow leading slashes * in the name. @@ -276,6 +283,10 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants { /** * Construct an entry with a name and a link flag. * + * <p>The entry's name will be the value of the {@code name} + * argument with all file separators replaced by forward slashes + * and leading slashes stripped.</p> + * * @param name the entry name * @param linkFlag the entry link flag. */ @@ -286,6 +297,11 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants { /** * Construct an entry with a name and a link flag. * + * <p>The entry's name will be the value of the {@code name} + * argument with all file separators replaced by forward + * slashes. Leading slashes are stripped if {@code + * preserveLeadingSlashes} is {@code false}.</p> + * * @param name the entry name * @param linkFlag the entry link flag. * @param preserveLeadingSlashes whether to allow leading slashes @@ -307,6 +323,11 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants { * header is constructed from information from the file. * The name is set from the normalized file path. * + * <p>The entry's name will be the value of the {@code file}'s + * path with all file separators replaced by forward slashes and + * leading slashes stripped. The name will end in a slash if the + * {@code file} represents a directory.</p> + * * @param file The file that the entry represents. */ public TarArchiveEntry(final File file) { @@ -317,6 +338,11 @@ public class TarArchiveEntry implements ArchiveEntry, TarConstants { * Construct an entry for a file. File is set to file, and the * header is constructed from information from the file. * + * <p>The entry's name will be the value of the {@code fileName} + * argument with all file separators replaced by forward slashes + * and leading slashes stripped. The name will end in a slash if the + * {@code file} represents a directory.</p> + * * @param file The file that the entry represents. * @param fileName the name to be used for the entry. */
