Package com.wavemaker.commons.io
Class FilterOn
- java.lang.Object
-
- com.wavemaker.commons.io.FilterOn
-
public abstract class FilterOn extends java.lang.ObjectBuilder class that can be used to easily constructResourceFilters. Filters can be built forFiles,Folders orResources with matching performed onnamesorpaths. Builders can be chained together to form compound (AND) matches.- See Also:
ResourceFilter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFilterOn.AttributeFilterTheResourceFilterand builder used to further restrict filtering.static classFilterOn.PathStylestatic classFilterOn.ResourceAttributeVarious attributes that can be used to filter resources.
-
Constructor Summary
Constructors Constructor Description FilterOn()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ResourceFilterantPattern(FilterOn.PathStyle pathStyle, java.lang.String... pattern)Returns an resource filter based on ant patterns.static ResourceFilterantPattern(java.lang.String... pattern)Returns an resource filter based on ant patterns.static FilterOn.AttributeFiltercaseSensitiveNames()static FilterOn.AttributeFiltercaseSensitivePaths()static FilterOn.AttributeFiltercaseSensitivePaths(FilterOn.PathStyle pathStyle)static FilterOn.AttributeFiltergetFor(FilterOn.ResourceAttribute attribute)Start filtering based on the specified resource type and attribute.static ResourceFilterhidden()Filter all hidden resources (ie resource names starting '.')static FilterOn.AttributeFilternames()static ResourceFilternonHidden()Filter all non-hidden resources (ie resource names not starting '.');static FilterOn.AttributeFilterpaths()static FilterOn.AttributeFilterpaths(FilterOn.PathStyle pathStyle)
-
-
-
Method Detail
-
names
public static FilterOn.AttributeFilter names()
- Returns:
- the filter
-
caseSensitiveNames
public static FilterOn.AttributeFilter caseSensitiveNames()
- Returns:
- the filter
-
paths
public static FilterOn.AttributeFilter paths()
Start filtering based onResourcepaths. NOTE: matching is case insensitive and paths are considered relative toResourceFilterContext.getSource().- Returns:
- the filter
-
paths
public static FilterOn.AttributeFilter paths(FilterOn.PathStyle pathStyle)
- Parameters:
pathStyle- the path match style- Returns:
- the filter
-
caseSensitivePaths
public static FilterOn.AttributeFilter caseSensitivePaths()
Start filtering based onResourcepaths. NOTE: matching is case sensitive and paths are considered relative toResourceFilterContext.getSource().- Returns:
- the filter
-
caseSensitivePaths
public static FilterOn.AttributeFilter caseSensitivePaths(FilterOn.PathStyle pathStyle)
- Returns:
- the filter
-
getFor
public static FilterOn.AttributeFilter getFor(FilterOn.ResourceAttribute attribute)
Start filtering based on the specified resource type and attribute.- Parameters:
resourceType- the resource typeattribute- the attribute- Returns:
- the filter
-
hidden
public static ResourceFilter hidden()
Filter all hidden resources (ie resource names starting '.')- Returns:
- the filter
-
nonHidden
public static ResourceFilter nonHidden()
Filter all non-hidden resources (ie resource names not starting '.');- Returns:
- the filter
-
antPattern
public static ResourceFilter antPattern(java.lang.String... pattern)
Returns an resource filter based on ant patterns. Paths are considered relative from theResourceFilterContext.getSource().- Parameters:
pattern- the ant pattern- Returns:
- a ant pattern based resource filter
-
antPattern
public static ResourceFilter antPattern(FilterOn.PathStyle pathStyle, java.lang.String... pattern)
Returns an resource filter based on ant patterns.- Parameters:
pattern- the ant pattern- Returns:
- a ant pattern based resource filter
-
-