public class DefaultWorkspaceFilter extends java.lang.Object implements Dumpable, WorkspaceFilter
PathFilterSet
s.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_VERSION |
static double |
SUPPORTED_VERSION |
Constructor and Description |
---|
DefaultWorkspaceFilter() |
Modifier and Type | Method and Description |
---|---|
void |
add(PathFilterSet set)
Add a #PathFilterSet for nodes items.
|
void |
add(PathFilterSet nodeFilter,
PathFilterSet propFilter)
Add a #PathFilterSet for node and property items.
|
void |
addPropertyFilterSet(PathFilterSet set)
Deprecated.
use
add(PathFilterSet, PathFilterSet) instead. |
boolean |
contains(java.lang.String path)
Checks if the given node path is contained in this workspace filter.
|
boolean |
covers(java.lang.String path)
Checks if the given node path is covered in this workspace filter.
|
void |
dump(DumpContext ctx,
boolean isLast)
Dumps some human readable information using the given context.
|
void |
dumpCoverage(Node rootNode,
ProgressTrackerListener listener)
Dumps the coverage of this filter against the given node to the listener.
|
void |
dumpCoverage(Session session,
ProgressTrackerListener listener,
boolean skipJcrContent)
Dumps the coverage of this filter using the given session.
|
PathFilterSet |
getCoveringFilterSet(java.lang.String path)
Returns the filter set that covers the respective node path
|
java.util.List<PathFilterSet> |
getFilterSets()
Returns a list of path filter sets for node items.
|
ImportMode |
getImportMode(java.lang.String path)
Returns the import mode for the given node path.
|
java.util.List<PathFilterSet> |
getPropertyFilterSets()
Returns a list of path filter sets for property items.
|
java.io.InputStream |
getSource()
Returns the source xml that constructs this filter
|
java.lang.String |
getSourceAsString()
Returns the source xml that constructs this filter
|
boolean |
isAncestor(java.lang.String path)
Checks if the given node path is an ancestor of any of the filter sets.
|
boolean |
isGloballyIgnored(java.lang.String path)
Checks if the given node path is globally ignored.
|
void |
load(java.io.File file)
Loads the workspace filter from the given file
|
void |
load(java.io.InputStream in)
Loads the workspace filter from the given input source
|
void |
resetSource()
Reset the source content to a null state.
|
void |
setGlobalIgnored(PathFilter ignored) |
void |
setImportMode(ImportMode importMode) |
WorkspaceFilter |
translate(PathMapping mapping)
Translates this workspace filter using the given path mapping.
|
public static final java.lang.String ATTR_VERSION
public static final double SUPPORTED_VERSION
public void add(PathFilterSet set)
set
- the set of filters to add.public void add(PathFilterSet nodeFilter, PathFilterSet propFilter)
nodeFilter
- the set of filters to add.propFilter
- the set of filters to add.@Deprecated public void addPropertyFilterSet(PathFilterSet set)
add(PathFilterSet, PathFilterSet)
instead.set
- the set of filters to add.public java.util.List<PathFilterSet> getFilterSets()
getFilterSets
in interface WorkspaceFilter
public java.util.List<PathFilterSet> getPropertyFilterSets()
getPropertyFilterSets
in interface WorkspaceFilter
public PathFilterSet getCoveringFilterSet(java.lang.String path)
getCoveringFilterSet
in interface WorkspaceFilter
path
- the pathnull
public ImportMode getImportMode(java.lang.String path)
getImportMode
in interface WorkspaceFilter
path
- path to checkImportMode.REPLACE
if the given path
is not covered by this filter.public void setImportMode(ImportMode importMode)
public boolean contains(java.lang.String path)
true
if any of the filter sets contain the path
and it's not globally ignored.contains
in interface WorkspaceFilter
path
- to checktrue
if the given path is included in this filter.public boolean covers(java.lang.String path)
true
if at least one of the sets covers
the path and is not globally ignored.covers
in interface WorkspaceFilter
path
- the pathto checktrue
if the given path is covered by this filter.public boolean isAncestor(java.lang.String path)
isAncestor
in interface WorkspaceFilter
path
- the item to checktrue
if the given item is an ancestorpublic boolean isGloballyIgnored(java.lang.String path)
isGloballyIgnored
in interface WorkspaceFilter
path
- the path to check.true
if the item is globally ignored.public WorkspaceFilter translate(PathMapping mapping)
translate
in interface WorkspaceFilter
mapping
- the path mappingpublic void load(java.io.File file) throws java.io.IOException, ConfigurationException
file
- sourceConfigurationException
- if the source is not validjava.io.IOException
- if an I/O error occurspublic java.io.InputStream getSource()
getSource
in interface WorkspaceFilter
public java.lang.String getSourceAsString()
getSourceAsString
in interface WorkspaceFilter
public void load(java.io.InputStream in) throws java.io.IOException, ConfigurationException
in
- sourceConfigurationException
- if the source is not validjava.io.IOException
- if an I/O error occurspublic void dump(DumpContext ctx, boolean isLast)
public void resetSource()
public void setGlobalIgnored(PathFilter ignored)
public void dumpCoverage(Node rootNode, ProgressTrackerListener listener) throws RepositoryException
dumpCoverage
in interface WorkspaceFilter
rootNode
- root nodelistener
- listenerRepositoryException
- if an error occurspublic void dumpCoverage(Session session, ProgressTrackerListener listener, boolean skipJcrContent) throws RepositoryException
skipJcrContent
is true
the jcr:content nodes are excluded from traversal and reporting.dumpCoverage
in interface WorkspaceFilter
session
- sessionlistener
- listener to report progressskipJcrContent
- true
to skip jcr:content nodesRepositoryException
- if an error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved