Ejemplo n.º 1
0
  @Test
  public void test010_deleteFiles() throws IOException {
    System.out.println("--- --- --- test010_deleteFiles() --- --- ---");

    // FileRef fileRef1 = FileRef.newInstance(fs, "/newDir/tmp2/newEmptyFile2.txt");
    // FileRef dirRef2 = FileRef.newInstance(fs, "/newDir/tmp3");
    FileRef dirRef3 = FileRef.newInstance(fs, "/osgi");

    // boolean succeed1 = fileRef1.delete();
    // boolean succeed2 = dirRef2.delete();
    boolean succeed3 = dirRef3.delete();

    // System.out.println("Path '" + fileRef1.getPath() + "' is deleted (succeed=" + succeed1 + ")?
    // " + !fileRef1.exists());
    // System.out.println("Path '" + dirRef2.getPath() + "' is deleted (succeed=" + succeed2 + ")? "
    // + !dirRef2.exists());
    System.out.println(
        "Path '"
            + dirRef3.getPath()
            + "' is deleted (succeed="
            + succeed3
            + ")? "
            + !dirRef3.exists());

    System.out.println();
  }
Ejemplo n.º 2
0
  @Ignore
  @Test
  public void test000_deleteAllFiles() throws IOException {
    System.out.println("--- --- --- test000_deleteAllFiles() --- --- ---");

    FileRef[] fileRefs = FileRef.listRoots(fs);
    for (FileRef fileRef : fileRefs) {
      boolean succeed = fileRef.delete();
      System.out.println(fileRef.getPath() + " is deleted? " + succeed);
    }

    System.out.println();
  }