Example usage for org.apache.hadoop.fs FileSystem access

List of usage examples for org.apache.hadoop.fs FileSystem access

Introduction

In this page you can find the example usage for org.apache.hadoop.fs FileSystem access.

Prototype

@InterfaceAudience.LimitedPrivate({ "HDFS", "Hive" })
public void access(Path path, FsAction mode) throws AccessControlException, FileNotFoundException, IOException 

Source Link

Document

Checks if the user can access a path.

Usage

From source file:com.mellanox.r4h.DistributedFileSystem.java

License:Apache License

@Override
public void access(Path path, final FsAction mode) throws IOException {
    final Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {
        @Override//  w  w  w . ja va  2s .  co m
        public Void doCall(final Path p) throws IOException {
            dfs.checkAccess(getPathName(p), mode);
            return null;
        }

        @Override
        public Void next(final FileSystem fs, final Path p) throws IOException {
            fs.access(p, mode);
            return null;
        }
    }.resolve(this, absF);
}