From 30a2d5153cfe2bd199a42c44ceb9b7a8e66ff8de Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 15 Apr 2012 15:38:59 +0000 Subject: [PATCH] * disable filename validation against characters not support by Windows via -Dunixfs=true --- source/net/sourceforge/filebot/cli/CmdlineOperations.java | 6 +++--- .../net/sourceforge/filebot/ui/rename/ValidateDialog.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/net/sourceforge/filebot/cli/CmdlineOperations.java b/source/net/sourceforge/filebot/cli/CmdlineOperations.java index 744e144a..ffdccf58 100644 --- a/source/net/sourceforge/filebot/cli/CmdlineOperations.java +++ b/source/net/sourceforge/filebot/cli/CmdlineOperations.java @@ -208,8 +208,8 @@ public class CmdlineOperations implements CmdlineInterface { String newName = (format != null) ? format.format(new MediaBindingBean(episode, file)) : validateFileName(EpisodeFormat.SeasonEpisode.format(episode)); File newFile = new File(outputDir, newName + "." + getExtension(file)); - if (isInvalidFilePath(newFile)) { - CLILogger.config("Stripping invalid characters from new name: " + newName); + if (isInvalidFilePath(newFile) && !Boolean.parseBoolean(System.getProperty("unixfs"))) { + CLILogger.config("Stripping invalid characters from new path: " + newName); newFile = validateFilePath(newFile); } @@ -435,7 +435,7 @@ public class CmdlineOperations implements CmdlineInterface { String newName = (format != null) ? format.format(new MediaBindingBean(movie, file)) : validateFileName(MovieFormat.NameYear.format(movie)); File newFile = new File(outputDir, newName + "." + getExtension(file)); - if (isInvalidFilePath(newFile)) { + if (isInvalidFilePath(newFile) && !Boolean.parseBoolean(System.getProperty("unixfs"))) { CLILogger.config("Stripping invalid characters from new path: " + newName); newFile = validateFilePath(newFile); } diff --git a/source/net/sourceforge/filebot/ui/rename/ValidateDialog.java b/source/net/sourceforge/filebot/ui/rename/ValidateDialog.java index 0bf3ad15..49519689 100644 --- a/source/net/sourceforge/filebot/ui/rename/ValidateDialog.java +++ b/source/net/sourceforge/filebot/ui/rename/ValidateDialog.java @@ -161,7 +161,7 @@ class ValidateDialog extends JDialog { for (int i = 0; i < source.size(); i++) { // invalid file names are also invalid file paths - if (isInvalidFilePath(source.get(i))) { + if (isInvalidFilePath(source.get(i)) && !Boolean.parseBoolean(System.getProperty("unixfs"))) { invalidFilePaths.addIndex(i); } }