Package de.mediathekview.mlib.tool
Class FilenameUtils
- java.lang.Object
-
- de.mediathekview.mlib.tool.FilenameUtils
-
public class FilenameUtils extends Object
User: crystalpalace1977 Date: 28.12.14 Time: 16:02
-
-
Field Summary
Fields Modifier and Type Field Description static StringREGEXP_ILLEGAL_CHARACTERS_OTHERSValid characters for all UNIX-like OS.static StringREGEXP_ILLEGAL_CHARACTERS_OTHERS_PATHstatic StringREGEXP_ILLEGAL_CHARACTERS_WINDOWSValid characters for Windows in file names: Based on http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspxstatic StringREGEXP_ILLEGAL_CHARACTERS_WINDOWS_PATH
-
Constructor Summary
Constructors Constructor Description FilenameUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcheckDateiname(String name, boolean isPath)static StringremoveIllegalCharacters(String input, boolean isPath)Remove illegal characters from String based on current OS.static StringreplaceLeerDateiname(String name, boolean isPath, boolean userReplace, boolean onlyAscii)Remove illegal file name characters
-
-
-
Field Detail
-
REGEXP_ILLEGAL_CHARACTERS_WINDOWS
public static final String REGEXP_ILLEGAL_CHARACTERS_WINDOWS
Valid characters for Windows in file names: Based on http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx- See Also:
- Constant Field Values
-
REGEXP_ILLEGAL_CHARACTERS_WINDOWS_PATH
public static final String REGEXP_ILLEGAL_CHARACTERS_WINDOWS_PATH
- See Also:
- Constant Field Values
-
REGEXP_ILLEGAL_CHARACTERS_OTHERS
public static final String REGEXP_ILLEGAL_CHARACTERS_OTHERS
Valid characters for all UNIX-like OS.- See Also:
- Constant Field Values
-
REGEXP_ILLEGAL_CHARACTERS_OTHERS_PATH
public static final String REGEXP_ILLEGAL_CHARACTERS_OTHERS_PATH
- See Also:
- Constant Field Values
-
-
Method Detail
-
removeIllegalCharacters
public static String removeIllegalCharacters(String input, boolean isPath)
Remove illegal characters from String based on current OS.- Parameters:
input- The input stringisPath- Flag to switch replacing of illegal path characters on and off- Returns:
- Cleaned-up string.
-
replaceLeerDateiname
public static String replaceLeerDateiname(String name, boolean isPath, boolean userReplace, boolean onlyAscii)
Remove illegal file name characters- Parameters:
name- The file nameisPath- Flag to switch replacing of illegal path characters on and offuserReplace- Flag to switch the user replacing table on and offonlyAscii- Flag to switch if only ASCII characters should be allowed- Returns:
- Bereinigte Fassung
-
-