From cff62892a17aa1958d3abbe6d1d4d0abb0dc6940 Mon Sep 17 00:00:00 2001 From: Mauricio Muler Bodemann Date: Tue, 10 Dec 2024 10:16:10 +0100 Subject: [PATCH] Creates a new list that contains metadata file names and extensions Fixes: SIRI-1028 --- src/main/java/sirius/kernel/commons/Files.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/sirius/kernel/commons/Files.java b/src/main/java/sirius/kernel/commons/Files.java index 7fa7d782..fef4c99f 100644 --- a/src/main/java/sirius/kernel/commons/Files.java +++ b/src/main/java/sirius/kernel/commons/Files.java @@ -18,6 +18,7 @@ import java.nio.file.Path; import java.nio.file.SimpleFileVisitor; import java.nio.file.attribute.BasicFileAttributes; +import java.util.List; import java.util.Optional; import java.util.regex.Pattern; @@ -28,6 +29,18 @@ public class Files { private static final Pattern NON_PATH_CHARACTERS = Pattern.compile("[^a-zA-Z0-9\\-.]"); + /** + * Contains a list of file names and endings which are considered to be metadata. + */ + private static final List METADATA_FILES = List.of( + "__MACOSX", + "thumbs.db", + ".ini", + "$RECYCLE.BIN", + ".sys", + ".tmp", + ".temp"); + private Files() { }