File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/util Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 2121import org .apache .hadoop .fs .Path ;
2222import org .apache .hadoop .fs .PathFilter ;
2323
24+ /**
25+ * A {@link PathFilter} that filters out hidden files. A file is considered to
26+ * be hidden, and should not be considered for processing, when the file name
27+ * starts with a period ('.') or an underscore ('_').
28+ */
2429public class HiddenFileFilter implements PathFilter {
2530 public static final HiddenFileFilter INSTANCE = new HiddenFileFilter ();
2631
2732 private HiddenFileFilter () {}
2833
2934 @ Override
3035 public boolean accept (Path p ) {
31- return !p .getName ().startsWith ("_" ) && !p .getName ().startsWith ("." );
36+ final char c = p .getName ().charAt (0 );
37+ return c != '.' && c != '_' ;
3238 }
3339}
You can’t perform that action at this time.
0 commit comments