Package org.syncany.cli
Class LsRemoteCommand
- java.lang.Object
-
- org.syncany.cli.Command
-
- org.syncany.cli.LsRemoteCommand
-
public class LsRemoteCommand extends Command
-
-
Constructor Summary
Constructors Constructor Description LsRemoteCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canExecuteInDaemonScope()
Returns whether a command can be run inside the scope of the daemon.int
execute(java.lang.String[] operationArgs)
This method implements the command-specific option-parsing, operation calling and output printing.CommandScope
getRequiredCommandScope()
A command can either be executed within an initialized local directory or in a regular (non-Syncany) directory.void
onLsRemoteStartEventReceived(LsRemoteStartSyncExternalEvent syncEvent)
OperationOptions
parseOptions(java.lang.String[] operationArgs)
A command can typically be configured using command line options.void
printResults(OperationResult operationResult)
A command typically prints a result to the console.
-
-
-
Constructor Detail
-
LsRemoteCommand
public LsRemoteCommand()
-
-
Method Detail
-
getRequiredCommandScope
public CommandScope getRequiredCommandScope()
Description copied from class:Command
A command can either be executed within an initialized local directory or in a regular (non-Syncany) directory. Syncany determines this by searching for a .syncany folder.The required command scope resembles whether or not a command must be executed inside a .syncany directory or not -- or whether it does not matter.
- Specified by:
getRequiredCommandScope
in classCommand
- Returns:
- Returns the required command scope of the command
-
canExecuteInDaemonScope
public boolean canExecuteInDaemonScope()
Description copied from class:Command
Returns whether a command can be run inside the scope of the daemon.If a folder is daemon-managed, the command line client passes the command to the daemon via REST and the daemon executes this command/operation. For some commands, this does not make sense or is dangerous. This method allows certain commands to be daemon-enabled, and other to be daemon-disabled.
- Specified by:
canExecuteInDaemonScope
in classCommand
-
execute
public int execute(java.lang.String[] operationArgs) throws java.lang.Exception
Description copied from class:Command
This method implements the command-specific option-parsing, operation calling and output printing. To do so, the method must read and evaluate the given arguments, prepare a corresponding operation, call it and display the results according to a well-defined format.Implementations should not move any business logic in the execute method (or any other parts of the command).
-
parseOptions
public OperationOptions parseOptions(java.lang.String[] operationArgs) throws java.lang.Exception
Description copied from class:Command
A command can typically be configured using command line options. This method parses these command line options and returns anOperationOptions
object representing the options.- Specified by:
parseOptions
in classCommand
- Throws:
java.lang.Exception
-
printResults
public void printResults(OperationResult operationResult)
Description copied from class:Command
A command typically prints a result to the console. This method takes anOperationResult
object and formats it to be human-readable.- Specified by:
printResults
in classCommand
-
onLsRemoteStartEventReceived
public void onLsRemoteStartEventReceived(LsRemoteStartSyncExternalEvent syncEvent)
-
-