Class FilenameUtils


  • public class FilenameUtils
    extends Object
    User: crystalpalace1977 Date: 28.12.14 Time: 16:02
    • 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
    • Constructor Detail

      • FilenameUtils

        public FilenameUtils()
    • Method Detail

      • checkDateiname

        public static String checkDateiname​(String name,
                                            boolean isPath)
      • removeIllegalCharacters

        public static String removeIllegalCharacters​(String input,
                                                     boolean isPath)
        Remove illegal characters from String based on current OS.
        Parameters:
        input - The input string
        isPath - 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 name
        isPath - Flag to switch replacing of illegal path characters on and off
        userReplace - Flag to switch the user replacing table on and off
        onlyAscii - Flag to switch if only ASCII characters should be allowed
        Returns:
        Bereinigte Fassung