OpslabJutil2.0历史API,请善用快捷进行搜索!

xxxxxxxxxx271static String GBK 中文超大字符集2static String ISO_8859_1 ISO 拉丁字母表 No.1,也叫作 ISO-LATIN-13static String US_ASCII 7位ASCII字符,也叫作ISO646-US、Unicode字符集的基本拉丁块4static String UTF_16 16 位 UCS 转换格式,字节顺序由可选的字节顺序标记来标识5static String UTF_16BE 16 位 UCS 转换格式,Big Endian(最低地址存放高位字节)字节顺序6static String UTF_16LE 16 位 UCS 转换格式,Little-endian(最高地址存放低位字节)字节顺序7static String UTF_8 8 位 UCS 转换格式8910static String changeCharset(String str, String newCharset)11 字符串编码转换的实现方法12static String changeCharset(String str, String oldCharset, String newCharset)13 字符串编码转换的实现方法14static String toASCII(String str)15 将字符编码转换成US-ASCII码16static String toGBK(String str)17 将字符编码转换成GBK码18static String toISO_8859_1(String str)19 将字符编码转换成ISO-8859-1码20static String toUTF_16(String str)21 将字符编码转换成UTF-16码22static String toUTF_16BE(String str)23 将字符编码转换成UTF-16BE码24static String toUTF_16LE(String str)25 将字符编码转换成UTF-16LE码26static String toUTF_8(String str)27 将字符编码转换成UTF-8码
xxxxxxxxxx181static List<String> getClassName(String packageName, boolean childPackage)2static String[] getField(String className)3 获取指定类的全部属性字段4static String[] getMethod(String className)5 获取对象的全部方法6static void getter(Object obj, String att)7 调用对象的getter方法8static String initStr(String old)9 Class loadClass(String className)10 加载指定的类11static <T> T propertiesCopy(Object obj, Class<T> type)12 同名属性值复制 将对象obj内属性名同类型T内容有同名属性的值复制到类型T中,并返回一个类型T的对象13static <T> T propertiesCopyIgnore(Object obj, Class<T> type)14 同名属性值复制(忽略大小写) 将对象obj内属性名同类型T内容有同名属性的值复制到类型T中,并返回一个类型T的对象15static <T> T propertiesCopyIgnoreFilter(Object obj, Class<T> type, String IgnoreStr)16 同名属性值复制(比较时忽略字符IgnoreStr的内容) 将对象obj内属性名同类型T内容有同名属性的值复制到类型T中,并返回一个类型T的对象17static void setter(Object obj, String att, Object value, Class<?> type)18 调用对象的setter方法xxxxxxxxxx111static String getFirstSpell(String chinese)2 获取汉字串拼音首字母,英文字符不变3static String getFullSpell(String chinese)4 获取汉字串拼音,英文字符不变5static String getPingYin(String inputString)6 将字符串中的中文转化为拼音,其他字符不变7static boolean isChinese(String strName)8static boolean isChineseByName(String str)9static boolean isChineseByREG(String str)10static boolean isMessyCode(String strName)11 判断是否是乱码xxxxxxxxxx61static int bytesToInt(byte[] bytes)2static long byteToLong(byte[] b)3static short byteToShort(byte[] b)4static byte[] intToByte(int i)5static byte[] longToByte(long number)6static byte[] shortToByte(short number)xxxxxxxxxx801static Date calculate(Date date, int second, String timeBurst)2 时间Date在时间段(例如每天的08:00-18:00)上增加或减去second秒3static Date calculate(String date, int second, String timeBurst)4 时间Date在时间段(例如每天的08:00-18:00)上增加或减去second秒5static String Date()6 获取当前的日期7static String Date(Date date)8 将指定的时间格式化成出返回9static Date Date(String dateStr)10 将指定的字符串解析为时间类型11static String DateTime()12 获取当前日期时间13static String DateTime(Date date)14 将指定的时间格式化成出返回15static Date DateTime(String datestr)16 将指定的字符串解析为时间类型17static Date day(Date date, int day)18 在指定的时间上加或减去几天19static Date day(int day)20 在当前时间的基础上加或减去几天21static Date hour(Date date, float hour)22 在制定的时间上加或减去几小时-支持浮点数23static Date hour(float hour)24 在当前时间的基础上加或减去几小时-支持浮点数25static boolean isDate(String date)26 判断字符串是否为日期字符串27static Date Minute(Date date, int minute)28 在制定的时间上加或减去几分钟29static Date Minute(int minute)30 在当前时间的基础上加或减去几分钟31static Date month(Date date, int month)32 在指定的时间上加或减去几月33static Date month(int month)34 在当前时间的基础上加或减去几月35static int subDay(Date startTime, Date endTime)36 获取俩个时间之前的相隔的天数37static int subDay(String startTime, String endTime)38 获取俩个时间之前的相隔的天数39static long subtimeBurst(Date startDate, Date endDate, String timeBurst)40 返回俩个时间在时间段(例如每天的08:00-18:00)的时长-单位秒41static long subtimeBurst(String startDate, String endDate, String timeBurst)42 返回俩个时间在时间段(例如每天的08:00-18:00)的时长-单位秒43static long Subtract(Date date1, Date date2)44 时间date1和date2的时间差-单位秒45static long Subtract(String date1, String date2)46 时间date1和date2的时间差-单位秒47static String SubtractDate(String date1, String date2)48 获取俩个时间的查结果用时秒表示49static int SubtractDay(Date date1, Date date2)50 时间date1和date2的时间差-单位天51static int SubtractDay(String date1, String date2)52 时间date1和date2的时间差-单位天53static int SubtractHour(Date date1, Date date2)54 时间date1和date2的时间差-单位小时55static int SubtractHour(String date1, String date2)56 时间date1和date2的时间差-单位小时57static int SubtractMinute(Date date1, Date date2)58 时间date1和date2的时间差-单位分钟59static int SubtractMinute(String date1, String date2)60 时间date1和date2的时间差 -单位分钟61static int SubtractMonth(Date date1, Date date2)62 时间date1和date2的时间差-单位月63static int SubtractMonth(String date1, String date2)64 时间date1和date2的时间差-单位月65static String SubtractTime(String date1, String date2)66 获取俩个时间的查结果用时秒表示67static int SubtractYear(Date date1, Date date2)68 时间date1和date2的时间差-单位年69static int SubtractYear(String date1, String date2)70 时间date1和date2的时间差-单位年71static String Time()72 获取当前的时间73static String Time(Date date)74 讲指定的时间格式化成出返回75static Date Time(String dateStr)76 将指定的字符串解析为时间类型77static Date year(Date date, int year)78 在指定的时间上加或减去几年79static Date year(int year)80 在当前时间的基础上加或减去year年xxxxxxxxxx41 void doSendHtmlEmail(String subject, String sendHtml, String receiveUser)2 发送邮件3 void doSendHtmlEmail(String subject, String sendHtml, String receiveUser, File attachment)4 发送邮件xxxxxxxxxx41static String commandPath(String file)2 返回一个通用的文件路径3static String getParentPath(String file)4 返回相一个目录的对于本身的相对父目录xxxxxxxxxx581static boolean appendLine(File file, String str)2 在文件末尾追加一行3static boolean appendLine(File file, String str, String encoding)4 在文件末尾追加一行5static boolean cleanFile(File file)6 快速清空一个超大的文件7static boolean copy(File file, String targetFile)8 复制文件 通过该方式复制文件文件越大速度越是明显9static boolean copy(String resourcePath, String targetPath)10 复制文件11static void copyDir(File filePath, String targetPath)12 复制目录13static void copyDir(String filePath, String targetPath)14 复制目录15static int countLines(File file)16 获取文件的行数17static String cpdetector(File file)18 获取文件的编码(cpDetector)探测19static boolean createFiles(String filePaht)20 创建文件支持多级目录21static void createPaths(String paths)22 创建多级目录23static boolean deleteBigFile(File file)24 快速的删除超大的文件25static boolean deleteDir(File file)26 删除一个目录27static boolean deleteFile(File file)28 删除一个文件29static String FileType(File file)30 获取文件的类型31static String hash(File file)32 获取文件的Hash33static List<String> Lines(File file)34 以列表的方式获取文件的所有行35static List<String> Lines(File file, int lines)36 以列表的方式获取文件的指定的行数数据37static List<String> Lines(File file, int lines, String encoding)38 以列表的方式获取文件的指定的行数数据39static List<String> Lines(File file, String encoding)40 以列表的方式获取文件的所有行41static List<File> listFile(File path)42 罗列指定路径下的全部文件43static List<File> listFile(String path)44 罗列指定路径下的全部文件45static List<File> listFileAll(File path)46 罗列指定路径下的全部文件包括文件夹47static List<File> listFileFilter(File dirPath, String postfixs)48 获取指定目录下的特点文件,通过后缀名过滤49static String MimeType(String file)50 获取文件的Mime类型51static Date modifyTime(File file)52 获取文件最后的修改时间53static List<File> searchFile(File dirPath, String fileName)54 在指定的目录下搜寻文个文件55static List<File> searchFileReg(File dirPath, String reg)56 查找符合正则表达式reg的的文件57static String SimpleEncoding(String file)58 利用简单的文件头字节特征探测文件编码xxxxxxxxxx91static void print(Enumeration enums)2 遍历打印Enumeration3static void print(List<?> list)4 遍历打印遍历List集合5static void print(Map map)6 遍历打印Map集合7static void print(String str)8static void println(Object obj)9static void println(String str)xxxxxxxxxx71static String GetAllProperties(String filePath)2 读取Properties的全部信息3static String GetValueByKey(String filePath, String key)4 根据Key读取Value5static String key(String key)6static void WriteProperties(String filePath, String pKey, String pValue)7 写入Properties信息xxxxxxxxxx231static int getNotSimple(int[] param, int len)2 每次生成的len位数都不相同3static String LowerString(int length)4 返回一个定长的随机纯大写字母字符串(只包含大小写字母)5static String MixString(int length)6 返回一个定长的随机纯字母字符串(只包含大小写字母)7static String number(int length)8static String String(int length)9 返回一个定长的随机字符串(只包含大小写字母、数字)10static String toFixdLengthString(int num, int fixdlenth)11 根据数字生成一个定长的字符串,长度不够前面补012static String toFixdLengthString(long num, int fixdlenth)13 根据数字生成一个定长的字符串,长度不够前面补014static String UpperString(int length)15 返回一个定长的随机纯小写字母字符串(只包含大小写字母)16static String ZeroString(int length)17 生成一个定长的纯0字符串18static String uuid()19 返回一个小写的uuid20 public final static String UUID()21 返回一个大写的uuid22 public static String squid()23 返回一个大写的有序列的uuidxxxxxxxxxx141static int countSubStrReg(String str, String reg)2 获取符合reg正则表达式的字符串在String中出现的次数3static boolean isABC(String src)4 判断是否纯字母组合5static boolean isEmail(String email)6static boolean isFloatNumeric(String src)7 判断是否浮点数字表示8static boolean isInteger(String str)9static boolean isMatche(String str, String reg)10 判断字符串str是否符合正则表达式reg11static boolean isNumeric(String src)12 判断是否数字表示13static boolean isNumericString(String src)14 判断是否数字表示xxxxxxxxxx21static String FileMD5(File file)2static String md5(String password)xxxxxxxxxx71static InputStream byte2InputStream(byte[] b)2static byte[] inputStream2Byte(InputStream inStream)3static byte[] stream2Byte(InputStream is)4 void streamSaveAsFile(InputStream is, File outfile)5 将流另存为文件6static String streamToString(InputStream in)7 Read an input stream into a stringxxxxxxxxxx621static int countSubStr(String string, String str)2 获取字符串str在String中出现的次数3 String cpDetector(String str)4 获取字符串的编码5static String formatFloat(float f, String format)6 格式化一个float7static String full2Half(String str)8 全角字符变半角字符9static String getHideEmailPrefix(String email)10 隐藏邮件地址前缀。11static String getLimitLengthString(String str, int len, String symbol)12 截取字符串 超出的字符用symbol代替13static int getStringLen(String SrcStr)14 取得字符串的实际长度(考虑了汉字的情况一个汉字按照俩个字符算)15static boolean isEmpty(String s)16 判断是否是空字符串 null和"" 都返回 true17static boolean isIn(String substring, String[] source)18 判断字符串数组中是否包含某字符串元素19static String joinString(List array, String symbol)20 把string array or list用给定的符号symbol连接成一个字符串21static String joinString(String[] array, String symbol)22 把string array or list用给定的符号symbol连接成一个字符串23static String left(String input, int count)24 截取字符串左侧指定长度的字符串25static String listToStringSlipStr(List list, String slipStr)26 将list 用传入的分隔符组装为String27static String ltrim(String str1, int num)28 截取字符串左侧的Num位29static String middle(String input, int index, int count)30 从指定位置开始截取指定长度的字符串31static Map<String,String> parseQuery(String query, char split1, char split2, String dupLink)32 解析字符串返回map键值对(例:a=1&b=2 => a=1,b=2)33static List<String> parseString2ListByCustomerPattern(String pattern, String src)34 根据指定的字符把源字符串分割成一个数组35static String repeat(String src, int num)36 repeat - 通过源字符串重复生成N次组成新的字符串。37static String replaceAll(String s, String sf, String sb)38 存文本替换39static String replaceBlank(String str)40 页面中去除字符串中的空格、回车、换行符、制表符41static String replaceBracketStr(String str)42 全角括号转为半角43static boolean requals(String str1, String str2)44 判定第一个字符串是否等于的第二个字符串中的某一个值45static boolean requals(String str1, String str2, String split)46 判定第一个字符串是否等于的第二个字符串中的某一个值47static String right(String input, int count)48 截取字符串右侧指定长度的字符串49static String rtrim(String str1, int num)50 截取字符串右侧的Num位51static double SimilarDegree(String str1, String str2)52 字符串相似度比较(速度较快)53static double SimilarityRatio(String str1, String str2)54 字符串相似度比较(速度较快)55 String SimpleEncoding(String str)56 获取字符串的编码57static String string2Unicode(String string)58static String subStringOmit(String subject, int size)59 字符串省略截取 字符串截取到指定长度size+...的形式60static String trimPunct(String str)61 删除所有的标点符号62static String unicode2String(String unicode)xxxxxxxxxx371static String CURRENT_USER2 当前用户3static String CURRENT_USER_DIR4 当用用户的工作目录5static String CURRENT_USER_HOME6 当前用户的家目录7static String FILE_SEPARATOR8static String HOST_IP9 主机IP10static String HOST_NAME11 主机名12static String JVM_ENCODING13 JVM的编码14static String JVM_TEMPDIR15 JVM默认的临时目录16static String JVM_VERSION17 JVM的版本18static String LINE_SEPARATOR19static String OS_ARCH20 主机架构21static String OS_NAME22 主机类型23static String OS_VERSION24 主机类型版本25static String PATH_SEPARATOR26static String SUN_DESKTOP27 操作系统类型28static long TotalMemorySize29 总的物理内存30static long JVMfreeMem()31 虚拟机空闲内存量32static long JVMmaxMem()33 虚拟机使用最大内存量34static long JVMtotalMem()35 获取JVM内存总量36static long usedMemory()37 已使用的物理内存xxxxxxxxxx81 static boolean isValid(Collection col)2 判断集合的有效性3 static boolean isValid(Object obj)4 判断一个对象是否为空5 static boolean isValid(Object[] arr)6 判断数组是否有效7 static boolean isValid(String src)8 判断字符串有效性xxxxxxxxxx81static String escape(String src)2static String getParamValue(String url, String paramName)3static void print(HttpServletRequest request)4static String removeParam(String url, String... paramNames)5static String removeParam(String url, String paramName)6static String setParam(String url, String paramName, String paramValue)7static String unescape(String src)8static String urlJoin(java.net.URL url, String locationHeader)xxxxxxxxxx51static void deCompress(File file, String dest)2 文档压缩3static void unCompress(File source, String path)4 文档解压5static void zipFile(File inFile, ZipOutputStream zos, String dir)xxxxxxxxxx131static void handler( Collection<T> collection, ObjectHandler<T> handler)2 处理集合中的元素3static <T, E> void process( Collection<T> collection, Collection<E> result, ObjectProcess<T, E> process)4 处理集合中的元素5``` 67### FileHelper89```java10static void handlerWithLine(File file, String encoding, ObjectHandler<String> handler)11 逐行处理文件内容12static <E> void processWithLine(File file,String encoding, Collection<E> result, ObjectProcess<String,E> process)13 逐行处理文件内容xxxxxxxxxx41static String encrypt(String secretKey, String Str)2 使用ASE加密字符串(返回纯16进制字符串)3static String decode(String secretKey, String str)4 使用ASE解密字符串(解密纯16进制字符串)xxxxxxxxxx41static byte[] encrypt(String key,String str)2 使用Blowfish加密算法加密字符串3static String decrypt(String key,byte[] tt)4 使用Blowfish加密算法解密字符串