Fix not allowing file-paths to have dots "." or parentheses "(", ")" in the directories-part of the path.

This commit is contained in:
Lampros Smyrnaios 2024-07-04 01:42:23 +03:00
parent 7a8270c69f
commit b8b83e3d74
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ public class FileUtils {
// The following regex might be useful in a future scenario. It extracts the "plain-filename" and "file-ID" and the "file-extension". // The following regex might be useful in a future scenario. It extracts the "plain-filename" and "file-ID" and the "file-extension".
// Possible full-filenames are: "path1/path2/ID.pdf", "ID2.pdf", "path1/path2/ID(12).pdf", "ID2(25).pdf" // Possible full-filenames are: "path1/path2/ID.pdf", "ID2.pdf", "path1/path2/ID(12).pdf", "ID2(25).pdf"
public static final Pattern FILEPATH_ID_EXTENSION = Pattern.compile("([^.()]+/)?((([^/()]+)[^./]*)(\\.[\\w]{2,10}))$"); public static final Pattern FILEPATH_ID_EXTENSION = Pattern.compile("(.*/)?((([^/()]+)[^./]*)(\\.[\\w]{2,10}))$");
public static final ExecutorService hashMatchingExecutor = Executors.newFixedThreadPool(6); public static final ExecutorService hashMatchingExecutor = Executors.newFixedThreadPool(6);
// TODO - Unify this ExecutorService with the hash-matching executorService. Since one will ALWAYS be called after the other. So why having two ExecServices to handle? // TODO - Unify this ExecutorService with the hash-matching executorService. Since one will ALWAYS be called after the other. So why having two ExecServices to handle?