From 6e47db92217c13157edc5b6075771aba90789a54 Mon Sep 17 00:00:00 2001 From: xonix Date: Mon, 2 Sep 2024 01:03:47 +0300 Subject: [PATCH] Fix symlinks handling #45 --- src/main/java/com/cmlteam/serv/HttpHandlerListing.java | 2 +- src/main/java/com/cmlteam/serv/TarUtil.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cmlteam/serv/HttpHandlerListing.java b/src/main/java/com/cmlteam/serv/HttpHandlerListing.java index dc17c2f..f5cb897 100644 --- a/src/main/java/com/cmlteam/serv/HttpHandlerListing.java +++ b/src/main/java/com/cmlteam/serv/HttpHandlerListing.java @@ -79,7 +79,7 @@ private void showList( } else if (file.isFile()) { writeFileRow(os, fIdxFixed, file); } else { - System.err.println(file.getName() + " is not supported"); + System.err.println("warning: not supported (symlink?): " + file); } } writeFooter(os); diff --git a/src/main/java/com/cmlteam/serv/TarUtil.java b/src/main/java/com/cmlteam/serv/TarUtil.java index 190c16d..45643f7 100644 --- a/src/main/java/com/cmlteam/serv/TarUtil.java +++ b/src/main/java/com/cmlteam/serv/TarUtil.java @@ -9,6 +9,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; +import java.nio.file.Files; class TarUtil { @@ -73,7 +74,7 @@ private static void addToArchiveCompression( } } } else { - System.out.println(file.getName() + " is not supported"); + System.err.println("warning: not supported (symlink?): " + file); } } }