public abstract class CommonUtils extends Object
| 构造器和说明 |
|---|
CommonUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
convertDirToUnixFormat(String dir,
boolean endWithSlash)
统一路径为UNIX格式
Examples: convertDirToUnixFormat("\", true) returns "/" convertDirToUnixFormat("D:\floder\", true) returns "D:/floder/" convertDirToUnixFormat("D:\floder\file", true) returns "D:/floder/file/" convertDirToUnixFormat("\", false) returns "" convertDirToUnixFormat("D:\floder\", false) returns "D:/floder" convertDirToUnixFormat("D:\floder\file", false) returns "D:/floder/file" |
static void |
sleep(int seconds)
程序暂停
|
public static void sleep(int seconds)
seconds - 暂停秒数public static String convertDirToUnixFormat(String dir, boolean endWithSlash)
convertDirToUnixFormat("\", true) returns "/"
convertDirToUnixFormat("D:\floder\", true) returns "D:/floder/"
convertDirToUnixFormat("D:\floder\file", true) returns "D:/floder/file/"
convertDirToUnixFormat("\", false) returns ""
convertDirToUnixFormat("D:\floder\", false) returns "D:/floder"
convertDirToUnixFormat("D:\floder\file", false) returns "D:/floder/file"
dir - 原始路径endWithSlash - 结尾是否追加斜杠Copyright © 2017. All rights reserved.