Examples of UtilException


Examples of com.xiaoleilu.hutool.exceptions.UtilException

    }
    final Boolean[] bools = new Boolean[values.length];
    for(int i = 0; i < values.length; i++) {
      final Boolean v = toBool(values[i], null);
      if(null == v && isIgnoreConvertError == false) {
        throw new UtilException(StrUtil.format("Convert [{}] to Boolean error!", values[i]));
      }
      bools[i] = v;
    }
    return bools;
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

 
  public Column(String tableName, ResultSet columnMetaRs) {
    try {
      init(tableName, columnMetaRs);
    } catch (SQLException e) {
      throw new UtilException(StrUtil.format("Get table [{}] meta info error!", tableName));
    }
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

    PrintWriter writer = null;
    try {
      writer = FileUtil.getPrintWriter(destPath, Velocity.getProperty(Velocity.OUTPUT_ENCODING).toString(), false);
      template.merge(context, writer);
    } catch (IOException e) {
      throw new UtilException(StrUtil.format("Write Velocity content to [{}] error!", destPath), e);
    }finally {
      FileUtil.close(writer);
    }
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

  public static String merge(String templateContent, VelocityContext context) {
    final StringWriter writer = new StringWriter();
    try {
      Velocity.evaluate(context, writer, RandomUtil.randomUUID(), templateContent);
    } catch (Exception e) {
      throw new UtilException(e);
    }
    return writer.toString();
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

    Writer writer = null;
    try {
      response.getWriter();
      toWriter(templateFileName, context, writer);
    } catch (Exception e) {
      throw new UtilException(StrUtil.format("Write Velocity content template by [{}] to response error!", templateFileName), e);
    }finally {
      FileUtil.close(writer);
    }
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

        str[k++] = hexDigits[byte0 >>> 4 & 0xf]; // 取字节中高 4 位的数字转换, >>> 为逻辑右移,将符号位一起右移
        str[k++] = hexDigits[byte0 & 0xf]; // 取字节中低 4 位的数字转换
      }
      s = new String(str); // 换后的结果转换为字符串
    } catch (Exception e) {
      throw new UtilException("Get MD5 error!", e);
    }
    return s;
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

    }
   
    try {
      return md5(source.getBytes(charset));
    } catch (UnsupportedEncodingException e) {
      throw new UtilException("Unsupported encoding: " + charset, e);
    }
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

      return source;
    }
    try {
      return new String(source.getBytes(srcCharset), newCharset);
    } catch (UnsupportedEncodingException unex) {
      throw new UtilException(unex);
    }
  }
View Full Code Here

Examples of com.xiaoleilu.hutool.exceptions.UtilException

    }
   
    try {
      return new String(data, charset);
    } catch (UnsupportedEncodingException e) {
      throw new UtilException(e);
    }
  }
View Full Code Here

Examples of org.jostraca.util.UtilException

      im.getInstance( "org.jostraca.util.NotAClassAtAllAtAll" );
    }
    catch( Exception e ) {
      //e.printStackTrace();
      assertTrue( e instanceof UtilException );
      UtilException ue = (UtilException) e;
      assertEquals( UtilException.CODE_class_error, ue.getCode() );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.