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

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

Introduction

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

Prototype

public void setXAttr(Path path, String name, byte[] value, EnumSet<XAttrSetFlag> flag) throws IOException 

Source Link

Document

Set an xattr of a file or directory.

Usage

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

License:Apache License

@Override
public void setXAttr(Path path, final String name, final byte[] value, final EnumSet<XAttrSetFlag> flag)
        throws IOException {
    Path absF = fixRelativePart(path);
    new FileSystemLinkResolver<Void>() {

        @Override/*from  w w  w .j  a va 2s .c  o m*/
        public Void doCall(final Path p) throws IOException {
            dfs.setXAttr(getPathName(p), name, value, flag);
            return null;
        }

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