类 BeetlUtil

java.lang.Object
org.beetl.core.misc.BeetlUtil

public class BeetlUtil extends Object
Beetl使用方法
作者:
xiandafu
  • 字段详细资料

    • webroot

      protected static String webroot
  • 构造器详细资料

    • BeetlUtil

      public BeetlUtil()
  • 方法详细资料

    • isOutsideOfRoot

      public static boolean isOutsideOfRoot(String child)
      判断一个路径是否指到外部了,比如../../test.txt就指到外部
    • getRelPath

      public static String getRelPath(String siblings, String resourceId)
      相对路径计算
      参数:
      siblings - 当前路径
      resourceId - 相对路径
      返回:
      绝对路径
    • getWriterByByteWriter

      public static Writer getWriterByByteWriter(ByteWriter byteWriter)
    • setWebroot

      public static void setWebroot(String webroot)
      自定义WebRoot路径
    • getWebRoot

      public static String getWebRoot()
      返回Web根路径,如果存在自定义webroot路径,则返回自定义webroot
    • checkNameing

      public static boolean checkNameing(String str)
      check 命名合法性
      参数:
      str - 需要check的字符串
    • getLog

      public static int[] getLog()
    • reportChineseTokenError

      public static String reportChineseTokenError(String msg)
      出现中文字符时,提示对应的英文字符
      参数:
      msg - 可能是中文的字符串
      返回:
      如果不是当前知道的中文字符,返回原来的字符串,否则提示出对应的英文字符
    • throwCastException

      public static RuntimeException throwCastException(ClassCastException ex, GroupTemplate gt)
    • autoFileFunctionRegister

      public static void autoFileFunctionRegister(GroupTemplate gt, File funtionRoot, String ns, String path, String functionSuffix)
    • getParameterDescription

      public static String getParameterDescription(Class[] types)