Example usage for org.apache.hadoop.fs Trash isEnabled

List of usage examples for org.apache.hadoop.fs Trash isEnabled

Introduction

In this page you can find the example usage for org.apache.hadoop.fs Trash isEnabled.

Prototype

public boolean isEnabled() 

Source Link

Document

Returns whether the trash is enabled for this filesystem

Usage

From source file:org.apache.ambari.view.filebrowser.HdfsApi.java

License:Apache License

/**
 * Check is trash enabled/* w w  w. ja va2 s.co  m*/
 * @return true if trash is enabled
 * @throws Exception
 */
public boolean trashEnabled() throws Exception {
    return ugi.doAs(new PrivilegedExceptionAction<Boolean>() {
        public Boolean run() throws IOException {
            Trash tr = new Trash(fs, conf);
            return tr.isEnabled();
        }
    });
}

From source file:org.apache.ambari.view.utils.hdfs.HdfsApi.java

License:Apache License

/**
 * Check is trash enabled//from  ww  w  .  j  ava  2 s .  c o  m
 * @return true if trash is enabled
 * @throws Exception
 */
public boolean trashEnabled() throws Exception {
    return execute(new PrivilegedExceptionAction<Boolean>() {
        public Boolean run() throws IOException {
            Trash tr = new Trash(fs, conf);
            return tr.isEnabled();
        }
    });
}