Class RestoreCommand

    • Field Detail

      • logger

        protected static final java.util.logging.Logger logger
    • 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 class Command
        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 class Command
      • 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).

        Specified by:
        execute in class Command
        Parameters:
        operationArgs - Command-specific arguments (might also contain global options)
        Returns:
        Returns a return code
        Throws:
        java.lang.Exception - If the command or the corresponding operation fails
      • parseOptions

        public RestoreOperationOptions 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 an OperationOptions object representing the options.
        Specified by:
        parseOptions in class Command
        Throws:
        java.lang.Exception