Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FileSystem.undelete()


      FileSystem fs = cluster.getFileSystem();
      TestCase.assertNotNull(DFSUtil.convertToDFS(fs));
     
      createFile(fs, new Path("/test/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/test/testDelete"), false));
      TestCase.assertTrue(fs.undelete(new Path("/test/testDelete"),
          System.getProperty("user.name")));

      fs.mkdirs(new Path("/tmp"));
      TestCase.assertTrue(fs.delete(new Path("/tmp"), false));
      TestCase.assertFalse(fs.undelete(new Path("/tmp"),
View Full Code Here


      TestCase.assertTrue(fs.undelete(new Path("/test/testDelete"),
          System.getProperty("user.name")));

      fs.mkdirs(new Path("/tmp"));
      TestCase.assertTrue(fs.delete(new Path("/tmp"), false));
      TestCase.assertFalse(fs.undelete(new Path("/tmp"),
          System.getProperty("user.name")));

      // temp directory automatically skips trash.
      createFile(fs, new Path("/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/tmp/testDelete"), false));
View Full Code Here

          System.getProperty("user.name")));

      // temp directory automatically skips trash.
      createFile(fs, new Path("/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/tmp/testDelete"), false));
      TestCase.assertFalse(fs.undelete(new Path("/tmp/testDelete"),
          System.getProperty("user.name")));

      fs.getConf().set("fs.trash.tmp.path.pattern", "{/tmp,/dir/,/dir1/*/dir3//}");
      createFile(fs, new Path("/dir1/dir2/dir3/dir5/file1"));
      TestCase.assertTrue(fs.delete(new Path("/dir1/dir2/dir3/dir5/file1"),
View Full Code Here

      fs.getConf().set("fs.trash.tmp.path.pattern", "{/tmp,/dir/,/dir1/*/dir3//}");
      createFile(fs, new Path("/dir1/dir2/dir3/dir5/file1"));
      TestCase.assertTrue(fs.delete(new Path("/dir1/dir2/dir3/dir5/file1"),
          false));
      TestCase.assertFalse(fs.undelete(new Path("/dir1/dir2/dir3/dir5/file1"),
          System.getProperty("user.name")));
      fs.mkdirs(new Path("/dir1/dir5/dir3/"));
      TestCase.assertTrue(fs.delete(new Path("/dir1/dir5/dir3/"),
          true));
      TestCase.assertFalse(fs.undelete(new Path("/dir1/dir5/dir3/"),
View Full Code Here

      TestCase.assertFalse(fs.undelete(new Path("/dir1/dir2/dir3/dir5/file1"),
          System.getProperty("user.name")));
      fs.mkdirs(new Path("/dir1/dir5/dir3/"));
      TestCase.assertTrue(fs.delete(new Path("/dir1/dir5/dir3/"),
          true));
      TestCase.assertFalse(fs.undelete(new Path("/dir1/dir5/dir3/"),
          System.getProperty("user.name")));
     

      createFile(fs, new Path("/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/tmp/testDelete"), false));
View Full Code Here

          System.getProperty("user.name")));
     

      createFile(fs, new Path("/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/tmp/testDelete"), false));
      TestCase.assertFalse(fs.undelete(new Path("/tmp/testDelete"),
          System.getProperty("user.name")));

      createFile(fs, new Path("/test/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/test/tmp/testDelete"), false));
      TestCase.assertTrue(fs.undelete(new Path("/test/tmp/testDelete"),
View Full Code Here

      TestCase.assertFalse(fs.undelete(new Path("/tmp/testDelete"),
          System.getProperty("user.name")));

      createFile(fs, new Path("/test/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/test/tmp/testDelete"), false));
      TestCase.assertTrue(fs.undelete(new Path("/test/tmp/testDelete"),
          System.getProperty("user.name")));
     
      // Test another delete() overload method with skipTrash=false
      fs.delete(new Path("/tmp"), true, true);
      fs.delete(new Path("/test"), true, true);
View Full Code Here

      // non empty directory is not moved if recursive is not set
      TestCase.assertFalse(fs.delete(new Path("/test"), false, false));

      // Files are expected to move to trash.
      TestCase.assertTrue(fs.delete(new Path("/test"), true, false));
      TestCase.assertTrue(fs.undelete(new Path("/test"),
          System.getProperty("user.name")));
      createFile(fs, new Path("/test1/testDelete"));
      TestCase.assertTrue(fs
          .delete(new Path("/test1/testDelete"), false, false));
      TestCase.assertTrue(fs.delete(new Path("/test1"), false, false));
View Full Code Here

          System.getProperty("user.name")));
      createFile(fs, new Path("/test1/testDelete"));
      TestCase.assertTrue(fs
          .delete(new Path("/test1/testDelete"), false, false));
      TestCase.assertTrue(fs.delete(new Path("/test1"), false, false));
      TestCase.assertTrue(fs.undelete(new Path("/test1"),
          System.getProperty("user.name")));
      TestCase.assertTrue(fs.undelete(new Path("/test1/testDelete"),
          System.getProperty("user.name")));

      // temp directory automatically skips trash.
View Full Code Here

      TestCase.assertTrue(fs
          .delete(new Path("/test1/testDelete"), false, false));
      TestCase.assertTrue(fs.delete(new Path("/test1"), false, false));
      TestCase.assertTrue(fs.undelete(new Path("/test1"),
          System.getProperty("user.name")));
      TestCase.assertTrue(fs.undelete(new Path("/test1/testDelete"),
          System.getProperty("user.name")));

      // temp directory automatically skips trash.
      createFile(fs, new Path("/tmp/testDelete"));
      TestCase.assertTrue(fs.delete(new Path("/tmp/testDelete"), false, false));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.