Package cn.dreampie.common.exception

Examples of cn.dreampie.common.exception.ValidateException


  @Override
  public boolean start() {
    properties = PropertiesUtils.me().loadPropertyFile(config);
    host = properties.getProperty("smtp.host", "");
    if (ValidateUtils.me().isNullOrEmpty(host)) {
      throw new ValidateException("email host has not found!");
    }
    port = properties.getProperty("smtp.port", "");

    ssl = properties.getProperty("smtp.ssl", "false");
    sslport = properties.getProperty("smtp.sslport", "");
//    if (Boolean.parseBoolean(ssl)) {
//      if (ValidateUtils.me().isNullOrEmpty(sslport)) {
//        throw new ValidateException("email ssl is true but sslport has not found!");
//      }
//    }
    timeout = properties.getProperty("smtp.timeout", "60000");
    tls = properties.getProperty("smtp.tls", "false");
    debug = properties.getProperty("smtp.debug", "false");
    user = properties.getProperty("smtp.user", "");

    if (ValidateUtils.me().isNullOrEmpty(user)) {
      throw new ValidateException("email user has not found!");
    }
    password = properties.getProperty("smtp.password", "");
    if (ValidateUtils.me().isNullOrEmpty(password)) {
      throw new ValidateException("email password has not found!");
    }

    name = properties.getProperty("smtp.name", "");

    from = properties.getProperty("smtp.from", "");
    if (ValidateUtils.me().isNullOrEmpty(from)) {
      throw new ValidateException("email from has not found!");
    }

    encode = properties.getProperty("smtp.encode", "UTF-8");
    mailerConf = new MailerConf(host, sslport, Integer.parseInt(timeout), port, Boolean.parseBoolean(ssl), Boolean.parseBoolean(tls), Boolean.parseBoolean(debug), user, password, name, from, encode);
View Full Code Here

TOP

Related Classes of cn.dreampie.common.exception.ValidateException

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.