Class SyncToolConfigParser

java.lang.Object
org.duracloud.sync.config.SyncToolConfigParser

public class SyncToolConfigParser extends Object
Handles reading the configuration parameters for the Sync Tool
  • Field Details

  • Constructor Details

    • SyncToolConfigParser

      public SyncToolConfigParser()
      Creates a parser for command line configuration options.
  • Method Details

    • processCommandLine

      public SyncToolConfig processCommandLine(String[] args)
      Parses command line configuration into an object structure, validates correct values along the way. Prints a help message and exits the JVM on parse failure.
      Parameters:
      args - command line configuration values
      Returns:
      populated SyncToolConfig
    • processConfigFileOptions

      protected SyncToolConfig processConfigFileOptions(String[] args) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • processStandardOptions

      protected SyncToolConfig processStandardOptions(String[] args) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • processStandardOptions

      protected SyncToolConfig processStandardOptions(String[] args, boolean requirePassword) throws org.apache.commons.cli.ParseException
      Throws:
      org.apache.commons.cli.ParseException
    • backupConfig

      protected void backupConfig(File backupDir, String[] args)
    • retrieveConfig

      protected String[] retrieveConfig(File configBackupFile)
    • retrievePrevConfig

      public SyncToolConfig retrievePrevConfig(File backupDir)
      Retrieves the configuration of the previous run of the Sync Tool. If there was no previous run, the backup file cannot be found, or the backup file cannot be read, returns null, otherwise returns the parsed configuration
      Parameters:
      backupDir - the current backup directory
      Returns:
      config for previous sync tool run, or null
    • getPasswordEnvVariable

      protected String getPasswordEnvVariable()
    • getConsole

      protected ConsolePrompt getConsole()