@InterfaceAudience.Public @InterfaceStability.Evolving public class GlobFilter extends Object implements PathFilter
Constructor and Description |
---|
GlobFilter(String filePattern)
Creates a glob filter with the specified file pattern.
|
GlobFilter(String filePattern,
PathFilter filter)
Creates a glob filter with the specified file pattern and an user filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Path path)
Tests whether or not the specified abstract pathname should be
included in a pathname list.
|
boolean |
hasPattern() |
public GlobFilter(String filePattern) throws IOException
filePattern
- the file pattern.IOException
- thrown if the file pattern is incorrect.public GlobFilter(String filePattern, PathFilter filter) throws IOException
filePattern
- the file pattern.filter
- user filter in addition to the glob pattern.IOException
- thrown if the file pattern is incorrect.public boolean hasPattern()
public boolean accept(Path path)
PathFilter
accept
in interface PathFilter
path
- The abstract pathname to be testedtrue
if and only if pathname
should be includedCopyright © 2023 Apache Software Foundation. All rights reserved.