@Component public class FileCommands extends ShellCommands
session_| Constructor and Description |
|---|
FileCommands() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
available() |
String |
cat(String path) |
String |
cd(String path) |
String |
ls(String path) |
String |
mkdir(String path) |
String |
pwd() |
afterReturningInvocation, afterThrowingInvocation, beforeInvocation, getCmdJsonOptionspublic FileCommands()
throws IOException
IOException@CliAvailabilityIndicator(value={"ls","pwd","cd","cat"})
public boolean available()
@CliCommand(value="ls",
help="Lists files and folders.")
public String ls(@CliOption(key={"","path","p"},help="Path")
String path)
throws Exception
Exception@CliCommand(value="pwd",
help="Print the absolute path of the current working directory.")
public String pwd()
throws IOException
IOException@CliCommand(value="cd",
help="Change the current directory to the specified path.")
public String cd(@CliOption(key={"","path","p"},specifiedDefaultValue="User\'s home directory")
String path)
throws IOException
IOException@CliCommand(value="mkdir",
help="Create a directory at the specified path.")
public String mkdir(@CliOption(key={"","path","p"})
String path)
throws IOException
IOException@CliCommand(value="cat",
help="Print the content of the specified file on the standard output")
public String cat(@CliOption(key={"","path","p"},mandatory=true,specifiedDefaultValue="File to print")
String path)
throws IOException
IOExceptionCopyright © 2017 Mapr Technologies, Inc.. All rights reserved.