Issue #2267 Removed java.nio.file dependencies from FilenameFilter.
Change-Id: I6af1cafe17609a6468a7805ccab61b28ecc0a733 Former-commit-id:057ba113b5
[formerly 36571478911119efe7195d51f6c820d6e745ccee] Former-commit-id:011c42b806
This commit is contained in:
parent
ac8136bd82
commit
433ee7d942
1 changed files with 20 additions and 21 deletions
|
@ -21,10 +21,6 @@ package com.raytheon.uf.common.util.file;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
/**
|
||||
* Consolidates common filename filters.
|
||||
|
@ -179,23 +175,26 @@ public final class FilenameFilters {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Accepts Path directories.
|
||||
*/
|
||||
public static final DirectoryStream.Filter<Path> ACCEPT_PATH_DIRECTORIES = new DirectoryStream.Filter<Path>() {
|
||||
public boolean accept(Path path) throws IOException {
|
||||
return (Files.isDirectory(path));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Accepts Path files.
|
||||
*/
|
||||
public static final DirectoryStream.Filter<Path> ACCEPT_PATH_FILES = new DirectoryStream.Filter<Path>() {
|
||||
public boolean accept(Path path) throws IOException {
|
||||
return (Files.isRegularFile(path));
|
||||
}
|
||||
};
|
||||
// TODO Code that can be uncommented after a transition to Java 1.7
|
||||
// /**
|
||||
// * Accepts Path directories.
|
||||
// */
|
||||
// public static final DirectoryStream.Filter<Path> ACCEPT_PATH_DIRECTORIES
|
||||
// = new DirectoryStream.Filter<Path>() {
|
||||
// public boolean accept(Path path) throws IOException {
|
||||
// return (Files.isDirectory(path));
|
||||
// }
|
||||
// };
|
||||
//
|
||||
// /**
|
||||
// * Accepts Path files.
|
||||
// */
|
||||
// public static final DirectoryStream.Filter<Path> ACCEPT_PATH_FILES = new
|
||||
// DirectoryStream.Filter<Path>() {
|
||||
// public boolean accept(Path path) throws IOException {
|
||||
// return (Files.isRegularFile(path));
|
||||
// }
|
||||
// };
|
||||
|
||||
/**
|
||||
* Returns a {@link FilenameFilter} that matches the specified file
|
||||
|
|
Loading…
Add table
Reference in a new issue