@PublicEvolving public abstract class FilePathFilter extends Object implements Serializable
filterPath(Path)
method is responsible for deciding if a path is eligible for
further processing or not. This can serve to exclude temporary or partial files that are still
being written.Modifier and Type | Class and Description |
---|---|
static class |
FilePathFilter.DefaultFilter
The default file path filtering method and is used if no other such function is provided.
|
Modifier and Type | Field and Description |
---|---|
static String |
HADOOP_COPYING
Name of an unfinished Hadoop file
|
Constructor and Description |
---|
FilePathFilter() |
Modifier and Type | Method and Description |
---|---|
static FilePathFilter |
createDefaultFilter()
Returns the default filter, which excludes the following files:
Files starting with "_"
Files starting with "."
Files containing the string "_COPYING_"
|
abstract boolean |
filterPath(Path filePath)
Returns
true if the filePath given is to be ignored when processing a
directory, e.g. |
public static final String HADOOP_COPYING
public abstract boolean filterPath(Path filePath)
true
if the filePath
given is to be ignored when processing a
directory, e.g.
public boolean filterPaths(Path filePath) {
return filePath.getName().startsWith(".") || filePath.getName().contains("_COPYING_");
}
public static FilePathFilter createDefaultFilter()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.