Class GlobbingPathHelper
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.observation.filter.GlobbingPathHelper
-
public class GlobbingPathHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description GlobbingPathHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
globPathAsRegex(String pathWithGlobs)
Converts the provided path containing glob characters*
and**
into a regular expression.
-
-
-
Method Detail
-
globPathAsRegex
public static String globPathAsRegex(String pathWithGlobs)
Converts the provided path containing glob characters*
and**
into a regular expression. The definition matches that of the GlobbingPathFilter with the addition that this conversion also supports sub-paths which do not start with a/
.The rules are:
- leading
**
matches/foo
andbar
- leading
/**
matches/foo
but notbar
- intermittent
**
matches zero or any number of path elements - trailing
**
matches anything not ending with a/
- single
*
matches anything except/
?
is not a special character- anything not a star is wrapped into
\Q...\E
pairs
- Parameters:
pathWithGlobs
- path that can contain * and **- Returns:
- a regular expression
- See Also:
GlobbingPathFilter
- leading
-
-