List of usage examples for org.apache.hadoop.fs Trash expunge
public void expunge() throws IOException
From source file:com.sensei.indexing.hadoop.reduce.ShardWriter.java
License:Apache License
public static void moveToTrash(Configuration conf, Path path) throws IOException { Trash t = new Trash(conf); boolean isMoved = t.moveToTrash(path); t.expunge(); if (!isMoved) { logger.error("Trash is not enabled or file is already in the trash."); }// w ww .j a v a 2s . c o m }
From source file:org.apache.ambari.view.filebrowser.HdfsApi.java
License:Apache License
/** * Empty trash/*from ww w .j a va 2 s . co m*/ * @return * @throws Exception */ public Void emptyTrash() throws Exception { return ugi.doAs(new PrivilegedExceptionAction<Void>() { public Void run() throws IOException { Trash tr = new Trash(fs, conf); tr.expunge(); return null; } }); }
From source file:org.apache.ambari.view.utils.hdfs.HdfsApi.java
License:Apache License
/** * Empty trash//w w w .ja v a 2 s .c om * @return * @throws Exception */ public Void emptyTrash() throws Exception { return execute(new PrivilegedExceptionAction<Void>() { public Void run() throws IOException { Trash tr = new Trash(fs, conf); tr.expunge(); return null; } }); }