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

    try {
      FileRef dirRef1 = FileRef.newInstance(fs, "/dir1");
      FileRef dirRef2 = FileRef.newInstance(fs, "/dir2");
      FileRef dirRef3 = FileRef.newInstance(fs, "/dir3");

      FileRef[] subFileRefs1 = FileRef.listFiles(dirRef1);
      FileRef[] subFileRefs2 = FileRef.listFiles(dirRef2);
      FileRef[] subFileRefs3 = FileRef.listFiles(dirRef3);

      System.out.println("Path '" + dirRef1.getPath() + "' members:");
      for (FileRef subFile1 : subFileRefs1) {
        FileSystemUtil.walkFolders(fs, subFile1, 0);
      }
      System.out.println();

      System.out.println("Path '" + dirRef2.getPath() + "' members:");
      for (FileRef subFile2 : subFileRefs2) {
        FileSystemUtil.walkFolders(fs, subFile2, 0);
      }
      System.out.println();

      System.out.println("Path '" + dirRef3.getPath() + "' members:");
      for (FileRef subFile3 : subFileRefs3) {
        FileSystemUtil.walkFolders(fs, subFile3, 0);
      }
      System.out.println();

    } catch (IOException e) {
      e.printStackTrace();
    }

    System.out.println();
  }
Example #2
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();
  }