* fix excessively long filenames

This commit is contained in:
Reinhard Pointner 2014-06-05 02:48:40 +00:00
parent 796e78a70f
commit 6613ebe67d
1 changed files with 2 additions and 2 deletions

View File

@ -479,9 +479,9 @@ public final class FileUtilities {
}
/**
* Invalid file name characters: \, /, :, *, ?, ", <, >, |, \r and \n
* Invalid file name characters: \, /, :, *, ?, ", <, >, |, \r, \n and excessive characters
*/
public static final Pattern ILLEGAL_CHARACTERS = Pattern.compile("[\\\\/:*?\"<>|\\r\\n]|[ ]+$|(?<=[^.])[.]+$");
public static final Pattern ILLEGAL_CHARACTERS = Pattern.compile("[\\\\/:*?\"<>|\\r\\n]|[ ]+$|(?<=[^.])[.]+$|(?<=.{250})(.+)(?=[.]\\p{Alnum}{3}$)");
/**
* Strip file name of invalid characters