Package io.roastedroot.zerofs
Enum PathNormalization
- All Implemented Interfaces:
Serializable,Comparable<PathNormalization>,Function<String,String>
Normalizations that can be applied to names in paths. Includes Unicode normalizations and
normalizations for case insensitive paths. These normalizations can be set in
Configuration.Builder when creating a ZeroFs file system instance and are automatically applied
to paths in the file system.-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract StringApplies this normalization to the given string, returning the normalized result.static PatterncompilePattern(String regex, Iterable<PathNormalization> normalizations) Compiles a regex pattern using flags based on the given normalizations.static Stringnormalize(String string, Iterable<PathNormalization> normalizations) Applies the given normalizations to the given string in order, returning the normalized result.intReturns the flags that should be used when creating a regexPatternin order to approximate this normalization.static PathNormalizationReturns the enum constant of this type with the specified name.static PathNormalization[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
NONE
No normalization. -
NFC
Unicode composed normalization (form NFC). -
NFD
Unicode decomposed normalization (form NFD). -
CASE_FOLD_UNICODE
Deprecated.Unicode case folding for case insensitive paths. Requires ICU4J on the classpath. -
CASE_FOLD_ASCII
ASCII case folding for simple case insensitive paths.
-
-
Field Details
-
patternFlags
private final int patternFlags
-
-
Constructor Details
-
PathNormalization
private PathNormalization(int patternFlags)
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
apply
Applies this normalization to the given string, returning the normalized result. -
patternFlags
public int patternFlags()Returns the flags that should be used when creating a regexPatternin order to approximate this normalization. -
normalize
Applies the given normalizations to the given string in order, returning the normalized result. -
compilePattern
Compiles a regex pattern using flags based on the given normalizations.
-