diff options
Diffstat (limited to 'src/java.base/share/classes/java/io/FileSystem.java')
| -rw-r--r-- | src/java.base/share/classes/java/io/FileSystem.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/java.base/share/classes/java/io/FileSystem.java b/src/java.base/share/classes/java/io/FileSystem.java index 50a890971a1..a1cea852d95 100644 --- a/src/java.base/share/classes/java/io/FileSystem.java +++ b/src/java.base/share/classes/java/io/FileSystem.java @@ -111,6 +111,15 @@ abstract class FileSystem { */ public abstract int getBooleanAttributes(File f); + /** + * Checks if all the given boolean attributes are true for the file or + * directory denoted by the given abstract pathname. False if it does not + * exist or some other I/O error occurs. + */ + public boolean hasBooleanAttributes(File f, int attributes) { + return (getBooleanAttributes(f) & attributes) == attributes; + } + @Native public static final int ACCESS_READ = 0x04; @Native public static final int ACCESS_WRITE = 0x02; @Native public static final int ACCESS_EXECUTE = 0x01; |
