Package ome.services.blitz.repo.path
Class FilePathRestrictions
- java.lang.Object
-
- ome.services.blitz.repo.path.FilePathRestrictions
-
public class FilePathRestrictions extends java.lang.ObjectCapture a set of rules by which local files may not be named on the file-system.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description charsafeCharactercom.google.common.collect.ImmutableSet<java.lang.Character>safeCharacterscom.google.common.collect.ImmutableMap<java.lang.Integer,java.lang.Integer>transformationMapcom.google.common.collect.ImmutableSetMultimap<java.lang.Integer,java.lang.Integer>transformationMatrixcom.google.common.collect.ImmutableSet<java.lang.String>unsafeNamescom.google.common.collect.ImmutableSet<java.lang.String>unsafePrefixescom.google.common.collect.ImmutableSet<java.lang.String>unsafeSuffixes
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FilePathRestrictionscombineFilePathRestrictions(FilePathRestrictions... rules)Combine sets of rules to form a set that satisfies them all and that include transformations away from Unicode control characters.
-
-
-
Field Detail
-
transformationMatrix
public final com.google.common.collect.ImmutableSetMultimap<java.lang.Integer,java.lang.Integer> transformationMatrix
-
unsafePrefixes
public final com.google.common.collect.ImmutableSet<java.lang.String> unsafePrefixes
-
unsafeSuffixes
public final com.google.common.collect.ImmutableSet<java.lang.String> unsafeSuffixes
-
unsafeNames
public final com.google.common.collect.ImmutableSet<java.lang.String> unsafeNames
-
safeCharacters
public final com.google.common.collect.ImmutableSet<java.lang.Character> safeCharacters
-
safeCharacter
public final char safeCharacter
-
transformationMap
public final com.google.common.collect.ImmutableMap<java.lang.Integer,java.lang.Integer> transformationMap
-
-
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 nullunsafePrefixes- which name prefixes are proscribed, may be nullunsafeSuffixes- which name suffixes are proscribed, may be nullunsafeNames- which names are proscribed, may be nullsafeCharacters- 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
-
-