Class FilePathRestrictions


  • public class FilePathRestrictions
    extends java.lang.Object
    Capture a set of rules by which local files may not be named on the file-system.
    Since:
    5.0
    • Constructor Detail

      • FilePathRestrictions

        public FilePathRestrictions​(com.google.common.collect.SetMultimap<java.lang.Integer,​java.lang.Integer> transformationMatrix,
                                    java.util.Set<java.lang.String> unsafePrefixes,
                                    java.util.Set<java.lang.String> unsafeSuffixes,
                                    java.util.Set<java.lang.String> unsafeNames,
                                    java.util.Set<java.lang.Character> safeCharacters)
        Construct a set of rules by which local files may not be named on the file-system.
        Parameters:
        transformationMatrix - how to make specific characters safe, may be null
        unsafePrefixes - which name prefixes are proscribed, may be null
        unsafeSuffixes - which name suffixes are proscribed, may be null
        unsafeNames - which names are proscribed, may be null
        safeCharacters - safe characters that may be used in making file names safe, may not be null
    • Method Detail

      • combineFilePathRestrictions

        public static FilePathRestrictions combineFilePathRestrictions​(FilePathRestrictions... rules)
        Combine sets of rules to form a set that satisfies them all and that include transformations away from Unicode control characters.
        Parameters:
        rules - at least one set of rules
        Returns:
        the intersection of the given rules, with full coverage for preventing control characters