Skip to content

Commit 17581ce

Browse files
committed
fix tar entry mode creation
1 parent ac74a84 commit 17581ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/org/xbib/io/archivers/tar/TarArchiveEntry.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ public String getName() {
410410
*/
411411
public TarArchiveEntry setName(String name) {
412412
this.name = normalizeFileName(name, false);
413+
boolean isDir = name.endsWith("/");
414+
this.mode = isDir ? DEFAULT_DIR_MODE : DEFAULT_FILE_MODE;
415+
this.linkFlag = isDir ? LF_DIR : LF_NORMAL;
413416
return this;
414417
}
415418

0 commit comments

Comments
 (0)