Package com.im.imjutil.exception

Examples of com.im.imjutil.exception.ValidationException


  /**
   * Construtor padrao
   */
  public CSVFile(List<CSVElement> elements) {
    if (Validator.isEmpty(elements)) {
      throw new ValidationException("Lista de elementos nula ou vazia.");
    }
    init();
    this.addAll(elements);
  }
View Full Code Here


  public void read(String string) {
    if (Validator.isValid(string)) {
      try {
        read(new BufferedReader(new StringReader(string)));
      } catch (IOException e) {
        throw new ValidationException("Erro na leitura do arquivo.", e);
      }
    }
  }
View Full Code Here

   * @param file O fluxo de entrada para o arquivo CSV
   * @throws IOException caso ocorra um erro de entrada ou saida
   */
  public void read(BufferedReader reader, boolean close) throws IOException {
    if (reader == null) {
      throw new ValidationException("Reader nulo");
    }
    CSVElement element;
    String line;
   
    while (reader.ready()) {
View Full Code Here

     
    } else if (fullEquals("file", command)) {
      saveFile(image, (File) params.get(1));
     
    } else {
      throw new ValidationException(Convert.toString(
          "Comando de abertura invalido: ", command));
    }
    return image;
  }
View Full Code Here

   *
   * @param implementation Classe de implementacao de {@link Session}
   */
  public SessionManager(Class<? extends Session> implementation) {
    if (!Validator.isValid(implementation)) {
      throw new ValidationException("Classe de implementacao invalida");
    }
    this.implementation = implementation;
    this.time = (30 * 60); // 30 minutos em segundos
    this.table = new HashMap<String, Session>();
    this.keygen = Sequence.getInstance(SequenceType.HASH);
View Full Code Here

   *
   * @param time O tempo de expiracao padrao para as sessoes criadas.
   */
  public void setTime(int time) {
    if (time <= 0) {
      throw new ValidationException(Convert.toString(
          "Tempo de sessao invalido: ", time));
    }
    this.time = time;
  }
View Full Code Here

   * @throws SessionException Caso ocorra algum erro ao criar a sessao.
   */
  public Session create(int time) throws SessionException {
    try {
      if (time <= 0) {
        throw new ValidationException(Convert.toString(
            "Tempo de sessao invalido: ", time));
      }
      Session session = implementation.newInstance();
      session.setExpirationDate(expirationDate(time));
      session.setId(createId());
View Full Code Here

     
    } else if (fullEquals("color", command)) {
      color = params.get(1);
     
    } else {
      throw new ValidationException(Convert.toString(
          "Comando de conversao invalido: ", command));
    }
    return ImageUtil.create(pi, format, color);
  }
View Full Code Here

   * @throws ValidationException A excessao lancada.
   */
  protected static void validateParam(Object... obj)
      throws ValidationException {
    if (!Validator.isValid(obj)) {
      throw new ValidationException("Parametro passado e nulo ou vazio");
    }
  }
View Full Code Here

   * @param base64 A string de bytes codificados em base64.
   * @return O byte array resultante.
   */
  public static byte[] toBytes(String base64) {
    if (!Validator.isValid(base64)) {
      throw new ValidationException("String base64 nulo ou vazio");
    }
    return Base64Coder.decrypt(base64);
  }
View Full Code Here

TOP

Related Classes of com.im.imjutil.exception.ValidationException

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.