List of usage examples for org.apache.hadoop.hdfs DistributedFileSystem rename
@SuppressWarnings("deprecation") @Override public boolean rename(Path src, Path dst) throws IOException
From source file:com.trace.hadoop.TestDFSRename.java
License:Apache License
private void rename(Path src, Path dst, boolean renameSucceeds, boolean quotaException) throws Exception { DistributedFileSystem fs = (DistributedFileSystem) cluster.getFileSystem(); try {//from w w w.j a v a 2 s. co m assertEquals(renameSucceeds, fs.rename(src, dst)); } catch (QuotaExceededException ex) { assertTrue(quotaException); } assertEquals(renameSucceeds, !fs.exists(src)); assertEquals(renameSucceeds, fs.exists(dst)); }