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

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

Introduction

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

Prototype

public static boolean moveToAppropriateTrash(FileSystem fs, Path p, Configuration conf) throws IOException 

Source Link

Document

In case of the symlinks or mount points, one has to move the appropriate trashbin in the actual volume of the path p being deleted.

Usage

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

License:Apache License

/**
 * Move to trash/*  w ww. j  av  a  2  s  .c  o  m*/
 * @param path path
 * @return success
 * @throws IOException
 * @throws InterruptedException
 */
public boolean moveToTrash(final String path) throws IOException, InterruptedException {
    return ugi.doAs(new PrivilegedExceptionAction<Boolean>() {
        public Boolean run() throws Exception {
            return Trash.moveToAppropriateTrash(fs, new Path(path), conf);
        }
    });
}

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

License:Apache License

/**
 * Move to trash//from w  ww . ja va 2s.c om
 * @param path path
 * @return success
 * @throws IOException
 * @throws InterruptedException
 */
public boolean moveToTrash(final String path) throws IOException, InterruptedException {
    return execute(new PrivilegedExceptionAction<Boolean>() {
        public Boolean run() throws Exception {
            return Trash.moveToAppropriateTrash(fs, new Path(path), conf);
        }
    });
}