List of usage examples for org.apache.hadoop.fs Trash moveToAppropriateTrash
public static boolean moveToAppropriateTrash(FileSystem fs, Path p, Configuration conf) throws IOException
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); } }); }