gboat2.attachment.util
类 ConfigUtil

java.lang.Object
  继承者 gboat2.attachment.util.ConfigUtil

public class ConfigUtil
extends Object

读取系统上传文件的路径的配置文件

从以下版本开始:
jdk1.6
作者:
tanxw

字段摘要
static String APACHE_STRATEGY
           
static String LIGHTTPD_STRATEGY
           
static String NGINX_STRATEGY
           
protected static Properties props
          cache config
static String STREAM_STRATEGY
           
 
构造方法摘要
protected ConfigUtil()
           
 
方法摘要
static String ensurePath(String path)
          make sure the path end with "/"
static String genearteNewFilename(String originalName)
          根据原始文件名生成新的文件名 :即当前时间戳+4位随机数+原始扩展名
static String generateRelativeSaveDir()
          得到由当前年月日组成的相对路径
static String getDownloadContextPath()
           
static String getDownloadStrategy()
           
static String getSavepathRoot()
           
static boolean isWindows()
           
static void main(String[] args)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

NGINX_STRATEGY

public static final String NGINX_STRATEGY
另请参见:
常量字段值

STREAM_STRATEGY

public static final String STREAM_STRATEGY
另请参见:
常量字段值

APACHE_STRATEGY

public static final String APACHE_STRATEGY
另请参见:
常量字段值

LIGHTTPD_STRATEGY

public static final String LIGHTTPD_STRATEGY
另请参见:
常量字段值

props

protected static Properties props
cache config

构造方法详细信息

ConfigUtil

protected ConfigUtil()
方法详细信息

getDownloadStrategy

public static String getDownloadStrategy()

generateRelativeSaveDir

public static String generateRelativeSaveDir()
得到由当前年月日组成的相对路径

返回:
String end with "/", but not start with "/".

genearteNewFilename

public static String genearteNewFilename(String originalName)
根据原始文件名生成新的文件名 :即当前时间戳+4位随机数+原始扩展名

参数:
fileName -
返回:
生成的新文件名

getDownloadContextPath

public static String getDownloadContextPath()
返回:
context down path, it always end with "/", eg: "files/".

ensurePath

public static String ensurePath(String path)
make sure the path end with "/"

参数:
path -
返回:

getSavepathRoot

public static String getSavepathRoot()
返回:
fiel save path root, it always end with "/", eg: "c:/files/".

isWindows

public static boolean isWindows()

main

public static void main(String[] args)
                 throws org.dom4j.DocumentException
抛出:
org.dom4j.DocumentException


Copyright © 2014 广联达软件股份有限公司(Glodon Software Co., Ltd.). All rights reserved.