org.apache.commons.io.file
Class DirectoryStreamFilter
- java.lang.Object
-
- org.apache.commons.io.file.DirectoryStreamFilter
-
- All Implemented Interfaces:
- DirectoryStream.Filter< Path>
public class DirectoryStreamFilter extends Object implements DirectoryStream.Filter<Path>
ADirectoryStream.Filter
that delegates to aPathFilter
.You pass this filter to
Files#newDirectoryStream(Path, DirectoryStream.Filter)
.- Since:
- 2.9.0
-
Constructor Summary
Constructors Constructor and Description DirectoryStreamFilter(PathFilter pathFilter)
Constructs a new instance for the given path filter.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description boolean
accept(Path path)
PathFilter
getPathFilter()
Gets the path filter.
-
Constructor Detail
DirectoryStreamFilter
public DirectoryStreamFilter(PathFilter pathFilter)
Constructs a new instance for the given path filter.- Parameters:
-
pathFilter
- How to filter paths.
Method Detail
accept
public boolean accept(Path path) throws IOException
- Specified by:
-
accept
in interfaceDirectoryStream.Filter<Path>
- Throws:
-
IOException
getPathFilter
public PathFilter getPathFilter()
Gets the path filter.- Returns:
- the path filter.
Copyright © 2002–2021 The Apache Software Foundation. All rights reserved.