private BackupOutcome runBackupWithLegacyArgs( Args args ) throws ToolFailureException { String from = args.get( FROM ).trim(); Path to = Paths.get( args.get( TO ).trim() ); Config tuningConfiguration = readConfiguration( args ); boolean forensics = args.getBoolean( FORENSICS, false, true ); ConsistencyCheck consistencyCheck = parseConsistencyChecker( args ); long timeout = args.getDuration( TIMEOUT, BackupClient.BIG_READ_TIMEOUT ); URI backupURI = resolveBackupUri( from, args, tuningConfiguration ); HostnamePort hostnamePort = newHostnamePort( backupURI ); return executeBackup( hostnamePort, to, consistencyCheck, tuningConfiguration, timeout, forensics ); }
private BackupOutcome runBackup( Args args ) throws ToolFailureException { String host = args.get( HOST ).trim(); int port = args.getNumber( PORT, BackupServer.DEFAULT_PORT ).intValue(); Path to = Paths.get( args.get( TO ).trim() ); Config tuningConfiguration = readConfiguration( args ); boolean forensics = args.getBoolean( FORENSICS, false, true ); ConsistencyCheck consistencyCheck = parseConsistencyChecker( args ); if ( host.contains( ":" ) ) { if ( !host.startsWith( "[" ) ) { host = "[" + host; } if ( !host.endsWith( "]" ) ) { host += "]"; } } long timeout = args.getDuration( TIMEOUT, BackupClient.BIG_READ_TIMEOUT ); URI backupURI = newURI( DEFAULT_SCHEME + "://" + host + ":" + port ); // a bit of validation HostnamePort hostnamePort = newHostnamePort( backupURI ); return executeBackup( hostnamePort, to, consistencyCheck, tuningConfiguration, timeout, forensics ); }