@@ -0,0 +1,2120 @@
+/*%0A * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0%0A * (the %22License%22). You may not use this work except in compliance with the License, which is%0A * available at www.apache.org/licenses/LICENSE-2.0%0A *%0A * This software is distributed on an %22AS IS%22 basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,%0A * either express or implied, as more fully set forth in the License.%0A *%0A * See the NOTICE file distributed with this work for information regarding copyright ownership.%0A */%0A%0Apackage alluxio.shell.command;%0A%0Aimport alluxio.AlluxioURI;%0Aimport alluxio.client.block.AlluxioBlockStore;%0Aimport alluxio.client.file.FileSystem;%0Aimport alluxio.client.file.URIStatus;%0Aimport alluxio.exception.AlluxioException;%0A%0Aimport org.apache.commons.cli.CommandLine;%0A%0Aimport java.io.IOException;%0A%0Aimport javax.annotation.concurrent.ThreadSafe;%0A%0A/**%0A * Displays the path's info.%0A * If path is a directory it displays the directory's info.%0A * If path is a file, it displays the file's all blocks info.%0A */%0A@ThreadSafe%0Apublic final class StatCommand extends WithWildCardPathCommand %7B%0A  /**%0A   * @param fs the filesystem of Alluxio%0A   */%0A  public StatCommand(FileSystem fs) %7B%0A    super(fs);%0A  %7D%0A%0A  @Override%0A  public String getCommandName() %7B%0A    return %22stat%22;%0A  %7D%0A%0A  @Override%0A  protected void runCommand(AlluxioURI path, CommandLine cl) throws AlluxioException, IOException %7B%0A    URIStatus status = mFileSystem.getStatus(path);%0A    if (status.isFolder()) %7B%0A      System.out.println(path + %22 is a directory path.%22);%0A      System.out.println(status);%0A    %7D else %7B%0A      System.out.println(path + %22 is a file path.%22);%0A      System.out.println(status);%0A      System.out.println(%22Containing the following blocks: %22);%0A      AlluxioBlockStore blockStore = AlluxioBlockStore.create();%0A      for (long blockId : status.getBlockIds()) %7B%0A        System.out.println(blockStore.getInfo(blockId));%0A      %7D%0A    %7D%0A  %7D%0A%0A  @Override%0A  public String getUsage() %7B%0A    return %22stat %3Cpath%3E%22;%0A  %7D%0A%0A  @Override%0A  public String getDescription() %7B%0A    return %22Displays info for the specified path both file and directory.%22;%0A  %7D%0A%7D%0A

Add stat command class file