Class RegexpPathMapping
java.lang.Object
org.apache.jackrabbit.vault.fs.api.RegexpPathMapping
- All Implemented Interfaces:
PathMapping
Implements a path mapping that supports regular expressions, i.e.
/etc/(.*)=/dummy/$1/custom- Since:
- 3.1.42
-
Field Summary
Fields inherited from interface org.apache.jackrabbit.vault.fs.api.PathMapping
IDENTITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,V> @NotNull RegexpPathMapping addAllMappings(@NotNull Map<K, V> pathsMappingMap) Allows importing mappings specified in data structure such as Map or Properties.@NotNull RegexpPathMappingaddMapping(@NotNull String fromPattern, @NotNull String toPattern) Add a new mapping based on regular expression.@NotNull StringMaps the given path to a new location.@NotNull StringMaps the given path to a new location.@NotNull RegexpPathMappingmerge(@Nullable RegexpPathMapping base) Merges the regexp mapping from the given base mapping.
-
Constructor Details
-
RegexpPathMapping
public RegexpPathMapping()
-
-
Method Details
-
addAllMappings
@NotNull public <K,V> @NotNull RegexpPathMapping addAllMappings(@NotNull @NotNull Map<K, V> pathsMappingMap) Allows importing mappings specified in data structure such as Map or Properties. All null entries (both keys and values) are ignored.- Type Parameters:
V- Value typeK- KEey type- Parameters:
pathsMappingMap- the data structure containing the mapping- Returns:
- this
-
addMapping
@NotNull public @NotNull RegexpPathMapping addMapping(@NotNull @NotNull String fromPattern, @NotNull @NotNull String toPattern) Add a new mapping based on regular expression.- Parameters:
fromPattern- the matching pattern, i.e./etc/(.*)toPattern- the replacing pattern, i.e./dummy/$1/custom- Returns:
- this
-
merge
Merges the regexp mapping from the given base mapping.- Parameters:
base- base mapping- Returns:
- this
-
map
Maps the given path to a new location.- Specified by:
mapin interfacePathMapping- Parameters:
path- the path- Returns:
- the mapped path.
-
map
Maps the given path to a new location.- Specified by:
mapin interfacePathMapping- Parameters:
path- the pathreverse- iftruea reverse mapping is applied- Returns:
- the mapped path.
-