Package co.cask.cdap.shell.exception

Examples of co.cask.cdap.shell.exception.CommandInputError


    verifyArgsFormat(args, argsFormat);
  }

  private void verifyArgsFormat(String[] args, String argsFormat) {
    if (argsFormat != null && args.length < argsFormat.split(" ").length) {
      throw new CommandInputError("Expected arguments: " + argsFormat);
    }
  }
View Full Code Here


  }

  @Override
  public void process(String[] args, PrintStream output) throws Exception {
    if (args.length < 1) {
      throw new CommandInputError("Expected arguments: " + argsFormat);
    }

    // Defaults for start time, end time, and limit if they are not provided.
    long startTime = 0L;
    long endTime = Long.MAX_VALUE;
View Full Code Here

          case 'h':
            return base + dir * TimeUnit.HOURS.toMillis(offset);
          case 'd':
            return base + dir * TimeUnit.DAYS.toMillis(offset);
          default:
            throw new CommandInputError("Unsupported time type " + type);
        }
      }
      if (arg.equalsIgnoreCase("min")) {
        return 0L;
      }
      if (arg.equalsIgnoreCase("max")) {
        return Long.MAX_VALUE;
      }

      return Long.parseLong(arg);
    } catch (NumberFormatException e) {
      throw new CommandInputError("Invalid number value: " + arg + ". Reason: " + e.getMessage());
    }
  }
View Full Code Here

  }

  @Override
  public void process(String[] args, PrintStream output) throws Exception {
    if (argsFormat != null && args.length < 2) {
      throw new CommandInputError("Expected arguments: " + argsFormat);
    }

    String[] programIdParts = args[0].split("\\.");
    String appId = programIdParts[0];
    String procedureId = programIdParts[1];
View Full Code Here

TOP

Related Classes of co.cask.cdap.shell.exception.CommandInputError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.