Class DefaultWorkspaceFilter
java.lang.Object
org.apache.jackrabbit.vault.fs.config.DefaultWorkspaceFilter
- All Implemented Interfaces:
Dumpable,WorkspaceFilter
- Direct Known Subclasses:
ScopedWorkspaceFilter
Holds a list of
PathFilterSets.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(PathFilterSet set) Add a #PathFilterSet for nodes items.voidadd(PathFilterSet nodeFilter, PathFilterSet propFilter) Add a #PathFilterSet for node and property items.voidDeprecated.booleanChecks if the given node path is contained (and by that also covered) in this workspace filter.booleanChecks if the given node path is covered in this workspace filter.voiddump(DumpContext ctx, boolean isLast) Dumps some human readable information using the given context.voiddumpCoverage(Node rootNode, ProgressTrackerListener listener) Dumps the coverage of this filter against the given node to the listener.voiddumpCoverage(Session session, ProgressTrackerListener listener, boolean skipJcrContent) Dumps the coverage of this filter using the given session.booleangetCoveringFilterSet(String path) Returns the filter set that covers the respective node pathReturns a list of path filter sets for node items.getImportMode(String path) Returns the import mode for the given node path.Returns a list of path filter sets for property items.Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.Returns the source xml that constructs this filterinthashCode()booleanincludesProperty(String propertyPath) Tests if the given workspace filter includes the given property.booleanisAncestor(String path) Checks if the given node path is an ancestor of any of the filter sets.booleanisGloballyIgnored(String path) Checks if the given node path is globally ignored.voidLoads the workspace filter from the given filevoidload(InputStream in) Loads the workspace filter from the given input source.voidvoidResets the source content to a null state.voidsetGlobalIgnored(PathFilter ignored) voidsetImportMode(ImportMode importMode) toString()translate(PathMapping mapping) Translates this workspace filter using the given path mapping.
-
Field Details
-
ATTR_VERSION
- See Also:
-
SUPPORTED_VERSION
public static final double SUPPORTED_VERSION- See Also:
-
-
Constructor Details
-
DefaultWorkspaceFilter
public DefaultWorkspaceFilter()
-
-
Method Details
-
add
Add a #PathFilterSet for nodes items.- Parameters:
set- the set of filters to add.
-
add
Add a #PathFilterSet for node and property items.- Parameters:
nodeFilter- the set of filters to add.propFilter- the set of filters to add.
-
addPropertyFilterSet
Deprecated.useadd(PathFilterSet, PathFilterSet)instead.Add a #PathFilterSet for properties items.- Parameters:
set- the set of filters to add.
-
getFilterSets
Returns a list of path filter sets for node items.- Specified by:
getFilterSetsin interfaceWorkspaceFilter- Returns:
- the list of path filter sets.
-
getPropertyFilterSets
Returns a list of path filter sets for property items.- Specified by:
getPropertyFilterSetsin interfaceWorkspaceFilter- Returns:
- the list of path filter sets.
-
getCoveringFilterSet
Returns the filter set that covers the respective node path- Specified by:
getCoveringFilterSetin interfaceWorkspaceFilter- Parameters:
path- the path- Returns:
- the filter set or
null
-
getImportMode
Returns the import mode for the given node path.- Specified by:
getImportModein interfaceWorkspaceFilter- Parameters:
path- path to check- Returns:
- the import mode or
ImportMode.REPLACEif the given path is not covered by this filter.
-
setImportMode
-
contains
Checks if the given node path is contained (and by that also covered) in this workspace filter. It returnstrueif any of the filter sets contain the path and it's not globally ignored.If
WorkspaceFilter.contains(String)returnstruefor one path, alsoWorkspaceFilter.covers(String)would returntruefor the same path, but not vice-versa.- Specified by:
containsin interfaceWorkspaceFilter- Parameters:
path- to check- Returns:
trueif the given path is included in this filter.
-
covers
Checks if the given node path is covered in this workspace filter. It only returnstrueif at least one of the sets covers the path and is not globally ignored.Still
WorkspaceFilter.contains(String)might returnfalsefor the same path in case there is some exclusion patterns matching the given path.- Specified by:
coversin interfaceWorkspaceFilter- Parameters:
path- the path to check- Returns:
trueif the given path is covered by this filter.
-
includesProperty
Description copied from interface:WorkspaceFilterTests if the given workspace filter includes the given property. If the filter does not cover the property, it returnstrue.- Specified by:
includesPropertyin interfaceWorkspaceFilter- Parameters:
propertyPath- the path to the property- Returns:
trueif the property is included in the filter
-
isAncestor
Checks if the given node path is an ancestor of any of the filter sets.- Specified by:
isAncestorin interfaceWorkspaceFilter- Parameters:
path- the item to check- Returns:
trueif the given item is an ancestor
-
isGloballyIgnored
Checks if the given node path is globally ignored.- Specified by:
isGloballyIgnoredin interfaceWorkspaceFilter- Parameters:
path- the path to check.- Returns:
trueif the item is globally ignored.
-
translate
Translates this workspace filter using the given path mapping.- Specified by:
translatein interfaceWorkspaceFilter- Parameters:
mapping- the path mapping- Returns:
- a new workspace filter
-
load
Loads the workspace filter from the given file- Parameters:
file- source- Throws:
ConfigurationException- if the source is not validIOException- if an I/O error occurs
-
getSource
Returns the source xml that constructs this filter It is the obligation of the caller to close the returned input stream.- Specified by:
getSourcein interfaceWorkspaceFilter- Returns:
- the source xml
-
getSourceAsString
Returns the source xml that constructs this filter- Specified by:
getSourceAsStringin interfaceWorkspaceFilter- Returns:
- the source xml
-
load
Loads the workspace filter from the given input source.The specified stream remains open after this method returns.
- Parameters:
in- source- Throws:
ConfigurationException- if the source is not validIOException- if an I/O error occurs
-
load
- Throws:
ConfigurationException
-
dump
Dumps some human readable information using the given context. -
resetSource
public void resetSource()Resets the source content to a null state. This leads to generating the source from scratch if necessary. Is called implicitly for every modifying operation (add(PathFilterSet),add(PathFilterSet, PathFilterSet),addPropertyFilterSet(PathFilterSet),load(Element),load(InputStream)andload(File)). -
setGlobalIgnored
-
dumpCoverage
public void dumpCoverage(Node rootNode, ProgressTrackerListener listener) throws RepositoryException Dumps the coverage of this filter against the given node to the listener.- Specified by:
dumpCoveragein interfaceWorkspaceFilter- Parameters:
rootNode- root nodelistener- listener which receives coverage information- Throws:
RepositoryException- if an error occurs
-
dumpCoverage
public void dumpCoverage(Session session, ProgressTrackerListener listener, boolean skipJcrContent) throws RepositoryException Dumps the coverage of this filter using the given session. IfskipJcrContentistruethe jcr:content nodes are excluded from traversal and reporting.- Specified by:
dumpCoveragein interfaceWorkspaceFilter- Parameters:
session- sessionlistener- listener which receives coverage informationskipJcrContent-trueto skip jcr:content nodes- Throws:
RepositoryException- if an error occurs
-
hashCode
public int hashCode() -
equals
-
toString
-
add(PathFilterSet, PathFilterSet)instead.