Exemplo n.º 1
0
  public static void main(String[] args) {
    if (args.length < 1) {
      StdOut.println("Args: <dir>");
      System.exit(-1);
    }

    Queue<String> fnames = new Queue<>();
    listFiles(new File(args[0]), fnames, 0);
    StdOut.println(CliUtils.iterableToString(fnames));
  }
Exemplo n.º 2
0
 public static void cliMode() {
   while (true) {
     StdOut.print("=> Enter folder name: ");
     String folder_name = StdIn.readString();
     Queue<String> fnames = new Queue<>();
     listFiles(new File(folder_name), fnames, 0);
     StdOut.println("<= Files: ");
     StdOut.println(CliUtils.iterableToString(fnames));
     StdOut.println();
   }
 }