public abstract class AppUtils extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
SERVER_HOME |
| 构造器和说明 |
|---|
AppUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Date |
addDate(Date d,
int filed,
int value)
修改时间
|
static void |
copyFrom(Object bean,
Map<String,Object> map)
Populate the
bean with map by bean's
setter. |
static boolean |
deleteFile(String path,
int timeoutSeconds) |
static String |
getNowString()
取得当前时间字符串
|
static String |
getTodayStr()
转换日期字符串格式
|
static String |
getTodayString()
取得当前日期字符串
|
static boolean |
isReachable(String host,
int port,
int timeout)
Check the
host:port available |
static boolean |
isSameDay(Date d1,
Date d2)
判断两个时间是否在同一天
|
static String |
leftPad(String str,
int len,
char pad)
左补齐
|
static void |
notNull(Object object,
String message) |
static String |
randomDigit(int len) |
static String |
renameFile(String oldPath,
String newPath,
int timeoutSeconds) |
static String |
rightPad(String str,
int len,
char pad)
右补齐
|
static String |
stripEnv(String str)
自动查找并替换给定字符串里的环境变量.
|
static String |
toDbField(String field)
e.g.
|
static String |
trimByLength(Object o,
int len)
截取字符串前LEN个字符
|
static Long |
valueOfLong(Object val) |
public static String getNowString()
public static String getTodayString()
public static String getTodayStr()
public static String stripEnv(String str)
str包含的环境变量格式:public static void copyFrom(Object bean, Map<String,Object> map)
bean with map by bean's
setter.public static boolean isReachable(String host, int port, int timeout)
host:port availablehost - the target hostport - the target porttimeout - the time, in milliseconds, before the call abortspublic static String renameFile(String oldPath, String newPath, int timeoutSeconds) throws InterruptedException
public static boolean deleteFile(String path, int timeoutSeconds) throws InterruptedException
public static Date addDate(Date d, int filed, int value)
d - filed - e.g. Calendar.SECONDvalue - public static String randomDigit(int len)
Copyright © 2015 cloudecho. All rights reserved.