Exemple #1
0
  @Ignore
  @Test
  public void test008_downloadDirectories() throws IOException {
    System.out.println("--- --- --- test008_downloadDirectories() --- --- ---");

    File localDir = new File("/Users/yayang/Downloads/test_target1");
    FileRef[] fileRefs = FileRef.listRoots(fs);
    for (FileRef fileRef : fileRefs) {
      boolean succeed = false;
      if (fileRef.isDirectory()) {
        succeed = fs.downloadFsDirectoryToDirectory(fileRef, localDir, true);
      } else {
        succeed = fs.downloadFsFileToDirectory(fileRef, localDir);
      }
      System.out.println(
          "Path '"
              + fileRef.getPath()
              + "' is downloaded to local dir '"
              + localDir.getAbsolutePath()
              + "'? "
              + succeed);
    }

    System.out.println();
  }
Exemple #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();
  }
Exemple #3
0
  @Test
  public void test001_listRoots() throws IOException {
    System.out.println("--- --- --- test001_listRoots() --- --- ---");

    try {
      FileRef[] fileRefs = FileRef.listRoots(fs);
      for (FileRef fileRef : fileRefs) {
        FileSystemUtil.walkFolders(fs, fileRef, 0);
      }
    } catch (IOException e) {
      e.printStackTrace();
    }

    System.out.println();
  }