Commit 2030969e by s_guodong

去掉commonUtil中的过时方法

parent e8a25b29
...@@ -24,19 +24,13 @@ import org.dom4j.Element; ...@@ -24,19 +24,13 @@ import org.dom4j.Element;
import org.dom4j.io.OutputFormat; import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader; import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter; import org.dom4j.io.XMLWriter;
import org.keyczar.exceptions.KeyczarException;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.datatype.XMLGregorianCalendar;
import java.io.*; import java.io.*;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.net.*; import java.net.*;
import java.security.InvalidKeyException;
import java.security.Key; import java.security.Key;
import java.security.NoSuchAlgorithmException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.DecimalFormat; import java.text.DecimalFormat;
...@@ -313,47 +307,6 @@ public class CommonFunctionUtils { ...@@ -313,47 +307,6 @@ public class CommonFunctionUtils {
return DateUtil.time2(paramString1, paramString2); return DateUtil.time2(paramString1, paramString2);
} }
@Deprecated
public static final String decodeAES(byte[] paramArrayOfByte,
String paramString1, String paramString2)
throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, IllegalBlockSizeException,
BadPaddingException, IOException {
return EncryptUtils.decodeAES(paramArrayOfByte, paramString1,
paramString2);
}
@Deprecated
public static final String decodeAES(String paramString)
throws KeyczarException {
return EncryptUtils.decodeAES(paramString);
}
@Deprecated
public static final String decodeDES(byte[] paramArrayOfByte,
String paramString1, String paramString2)
throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, IllegalBlockSizeException,
BadPaddingException, IOException {
return EncryptUtils.decodeDES(paramArrayOfByte, paramString1,
paramString2);
}
@Deprecated
public static final String encodeAES(String paramString)
throws KeyczarException {
return EncryptUtils.encodeAES(paramString);
}
@Deprecated
public static final String encodeDES(byte[] paramArrayOfByte,
String paramString1, String paramString2)
throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, IllegalBlockSizeException,
BadPaddingException, IOException {
return EncryptUtils.encodeDES(paramArrayOfByte, paramString1,
paramString2);
}
public static boolean copyFile(String resFilePath, String distFolder) { public static boolean copyFile(String resFilePath, String distFolder) {
return FileUtil.copyFile(resFilePath, distFolder); return FileUtil.copyFile(resFilePath, distFolder);
...@@ -530,16 +483,14 @@ public class CommonFunctionUtils { ...@@ -530,16 +483,14 @@ public class CommonFunctionUtils {
/** /**
* 字符串转化为Date类型 * 字符串转化为Date类型
* *
* @param date * @param date 日期字符串
* 日期字符串 * @param parsePattern 日期格式
* @param parsePattern
* 日期格式
* @return * @return
* @throws ParseException * @throws ParseException
*/ */
public static Date parseDate(String date, String parsePattern) public static Date parseDate(String date, String parsePattern)
throws ParseException { throws ParseException {
return DateUtils.parseDate(date, new String[] { parsePattern }); return DateUtils.parseDate(date, new String[]{parsePattern});
} }
public static double accurateDivide(double dividend, double divisor, public static double accurateDivide(double dividend, double divisor,
...@@ -766,7 +717,9 @@ public class CommonFunctionUtils { ...@@ -766,7 +717,9 @@ public class CommonFunctionUtils {
return new Gson().fromJson(json, beantype); return new Gson().fromJson(json, beantype);
} }
/** 该函数暂时不要删除,特殊场景需要用到 **/ /**
* 该函数暂时不要删除,特殊场景需要用到
**/
public static boolean isFlag(byte[] bitmap) { public static boolean isFlag(byte[] bitmap) {
byte b = bitmap[0]; byte b = bitmap[0];
String s = ByteUtil.byte2bits(b); String s = ByteUtil.byte2bits(b);
...@@ -781,7 +734,9 @@ public class CommonFunctionUtils { ...@@ -781,7 +734,9 @@ public class CommonFunctionUtils {
return Class.forName(classname); return Class.forName(classname);
} }
/** 洛阳银行使用函数,不要删除 **/ /**
* 洛阳银行使用函数,不要删除
**/
public static boolean fileupname(String path) { public static boolean fileupname(String path) {
boolean rename = false; boolean rename = false;
File f = new File(path); File f = new File(path);
...@@ -803,7 +758,9 @@ public class CommonFunctionUtils { ...@@ -803,7 +758,9 @@ public class CommonFunctionUtils {
return rename; return rename;
} }
/** 洛阳银行使用函数,不要删除 **/ /**
* 洛阳银行使用函数,不要删除
**/
public static boolean filelowname(String path) { public static boolean filelowname(String path) {
boolean rename = false; boolean rename = false;
File f = new File(path); File f = new File(path);
...@@ -906,14 +863,10 @@ public class CommonFunctionUtils { ...@@ -906,14 +863,10 @@ public class CommonFunctionUtils {
/** /**
* 会死循环,不建议使用 * 会死循环,不建议使用
* *
* @param source * @param source 原始字符串
* 原始字符串 * @param maxByteLen 字符编码
* @param maxByteLen * @param maxByteLen 最大截取长度
* 字符编码 * @param flag 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
* @param maxByteLen
* 最大截取长度
* @param flag
* 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
**/ **/
@Deprecated @Deprecated
public static String str4(String source, String encode, int maxByteLen, public static String str4(String source, String encode, int maxByteLen,
...@@ -935,12 +888,9 @@ public class CommonFunctionUtils { ...@@ -935,12 +888,9 @@ public class CommonFunctionUtils {
} }
/** /**
* @param source * @param source 原始字符串
* 原始字符串 * @param maxByteLen 截取的字节数
* @param maxByteLen * @param flag 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
* 截取的字节数
* @param flag
* 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
* @return 截取后的字符串 * @return 截取后的字符串
* @throws UnsupportedEncodingException * @throws UnsupportedEncodingException
**/ **/
...@@ -1016,18 +966,18 @@ public class CommonFunctionUtils { ...@@ -1016,18 +966,18 @@ public class CommonFunctionUtils {
} }
// 解析GTP使用的映射 // 解析GTP使用的映射
private static String[][] unpackRuleMappings = new String[][] { private static String[][] unpackRuleMappings = new String[][]{
{ "\\\\\\\\", "__backslash__", "\\\\" }, {"\\\\\\\\", "__backslash__", "\\\\"},
{ "\\\\=", "__equal__", "=" }, {"\\\\=", "__equal__", "="},
{ "\\\\\\[", "__leftbracket__", "[" }, {"\\\\\\[", "__leftbracket__", "["},
{ "\\\\]", "__rightbracket__", "]" }, {"\\\\]", "__rightbracket__", "]"},
{ "\\\\\\{", "__leftbrace__", "{" }, {"\\\\\\{", "__leftbrace__", "{"},
{ "\\\\}", "__rightbrace__", "}" }, { "\\\\,", "__comma__", "," } }; {"\\\\}", "__rightbrace__", "}"}, {"\\\\,", "__comma__", ","}};
// 组装GTP使用的映射 // 组装GTP使用的映射
private static String[][] packRuleMappings = new String[][] { private static String[][] packRuleMappings = new String[][]{
{ "\\\\", "\\\\\\\\" }, { "=", "\\\\=" }, { "\\[", "\\\\[" }, {"\\\\", "\\\\\\\\"}, {"=", "\\\\="}, {"\\[", "\\\\["},
{ "]", "\\\\]" }, { "\\{", "\\\\{" }, { "}", "\\\\}" }, {"]", "\\\\]"}, {"\\{", "\\\\{"}, {"}", "\\\\}"},
{ ",", "\\\\," } }; {",", "\\\\,"}};
public static Map gtpToMap(String str) { public static Map gtpToMap(String str) {
...@@ -1353,10 +1303,10 @@ public class CommonFunctionUtils { ...@@ -1353,10 +1303,10 @@ public class CommonFunctionUtils {
String[] interval = times[i].split("\\-"); String[] interval = times[i].split("\\-");
if (interval.length == 2) { if (interval.length == 2) {
if (interval[0].compareTo(interval[1]) >= 0) { if (interval[0].compareTo(interval[1]) >= 0) {
tmp.add(new String[] { interval[0], "24:00" }); tmp.add(new String[]{interval[0], "24:00"});
tmp.add(new String[] { "00:00", interval[1] }); tmp.add(new String[]{"00:00", interval[1]});
} else { } else {
tmp.add(new String[] { interval[0], interval[1] }); tmp.add(new String[]{interval[0], interval[1]});
} }
} }
...@@ -1413,16 +1363,16 @@ public class CommonFunctionUtils { ...@@ -1413,16 +1363,16 @@ public class CommonFunctionUtils {
if (diffTime == 0) { if (diffTime == 0) {
if (next.equals("00:00")) if (next.equals("00:00"))
next = "24:00"; next = "24:00";
result.add(new String[] { start, next }); result.add(new String[]{start, next});
return diffTime; return diffTime;
} }
if (diffTime > 0) { if (diffTime > 0) {
result.add(new String[] { start, null }); result.add(new String[]{start, null});
} else { } else {
if (next.equals("00:00")) if (next.equals("00:00"))
next = "24:00"; next = "24:00";
result.add(new String[] { start, next }); result.add(new String[]{start, next});
diffTime = loopTimelot(result, next, end, pattern, type); diffTime = loopTimelot(result, next, end, pattern, type);
} }
...@@ -1512,14 +1462,10 @@ public class CommonFunctionUtils { ...@@ -1512,14 +1462,10 @@ public class CommonFunctionUtils {
/** /**
* 提炼FileConnection的写文件功能 * 提炼FileConnection的写文件功能
* *
* @param content * @param content 待写入文件的内容,可以是字节数组或者字符串
* 待写入文件的内容,可以是字节数组或者字符串 * @param path 文件路径
* @param path * @param append 是追加写到文件末尾还是从文件开始处写
* 文件路径 * @param encode 文件内容编码
* @param append
* 是追加写到文件末尾还是从文件开始处写
* @param encode
* 文件内容编码
*/ */
public static void writeFile(Object content, String path, boolean append, public static void writeFile(Object content, String path, boolean append,
String encode) { String encode) {
...@@ -1715,12 +1661,9 @@ public class CommonFunctionUtils { ...@@ -1715,12 +1661,9 @@ public class CommonFunctionUtils {
/** /**
* 由XML元素获取XML字符串 * 由XML元素获取XML字符串
* *
* @param element * @param element XML元素
* XML元素 * @param indent 缩进填充字符串
* @param indent * @param newlines 是否折行
* 缩进填充字符串
* @param newlines
* 是否折行
* @return XML字符串 * @return XML字符串
*/ */
public static String Stringize(Element element, String indent, public static String Stringize(Element element, String indent,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment