Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
be-esb-core
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
be-esb-ecosystem-maven
be-esb-core
Commits
2030969e
Commit
2030969e
authored
Aug 11, 2022
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉commonUtil中的过时方法
parent
e8a25b29
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
100 deletions
+43
-100
CommonFunctionUtils.java
src/main/src/com/brilliance/eibs/el/CommonFunctionUtils.java
+43
-100
No files found.
src/main/src/com/brilliance/eibs/el/CommonFunctionUtils.java
View file @
2030969e
...
...
@@ -24,19 +24,13 @@ import org.dom4j.Element;
import
org.dom4j.io.OutputFormat
;
import
org.dom4j.io.SAXReader
;
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.XMLGregorianCalendar
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.net.*
;
import
java.security.InvalidKeyException
;
import
java.security.Key
;
import
java.security.NoSuchAlgorithmException
;
import
java.sql.Timestamp
;
import
java.text.DateFormat
;
import
java.text.DecimalFormat
;
...
...
@@ -313,47 +307,6 @@ public class CommonFunctionUtils {
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
)
{
return
FileUtil
.
copyFile
(
resFilePath
,
distFolder
);
...
...
@@ -530,16 +483,14 @@ public class CommonFunctionUtils {
/**
* 字符串转化为Date类型
*
* @param date
* 日期字符串
* @param parsePattern
* 日期格式
* @param date 日期字符串
* @param parsePattern 日期格式
* @return
* @throws ParseException
*/
public
static
Date
parseDate
(
String
date
,
String
parsePattern
)
throws
ParseException
{
return
DateUtils
.
parseDate
(
date
,
new
String
[]
{
parsePattern
});
return
DateUtils
.
parseDate
(
date
,
new
String
[]{
parsePattern
});
}
public
static
double
accurateDivide
(
double
dividend
,
double
divisor
,
...
...
@@ -766,7 +717,9 @@ public class CommonFunctionUtils {
return
new
Gson
().
fromJson
(
json
,
beantype
);
}
/** 该函数暂时不要删除,特殊场景需要用到 **/
/**
* 该函数暂时不要删除,特殊场景需要用到
**/
public
static
boolean
isFlag
(
byte
[]
bitmap
)
{
byte
b
=
bitmap
[
0
];
String
s
=
ByteUtil
.
byte2bits
(
b
);
...
...
@@ -781,7 +734,9 @@ public class CommonFunctionUtils {
return
Class
.
forName
(
classname
);
}
/** 洛阳银行使用函数,不要删除 **/
/**
* 洛阳银行使用函数,不要删除
**/
public
static
boolean
fileupname
(
String
path
)
{
boolean
rename
=
false
;
File
f
=
new
File
(
path
);
...
...
@@ -803,7 +758,9 @@ public class CommonFunctionUtils {
return
rename
;
}
/** 洛阳银行使用函数,不要删除 **/
/**
* 洛阳银行使用函数,不要删除
**/
public
static
boolean
filelowname
(
String
path
)
{
boolean
rename
=
false
;
File
f
=
new
File
(
path
);
...
...
@@ -906,14 +863,10 @@ public class CommonFunctionUtils {
/**
* 会死循环,不建议使用
*
* @param source
* 原始字符串
* @param maxByteLen
* 字符编码
* @param maxByteLen
* 最大截取长度
* @param flag
* 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
* @param source 原始字符串
* @param maxByteLen 字符编码
* @param maxByteLen 最大截取长度
* @param flag 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
**/
@Deprecated
public
static
String
str4
(
String
source
,
String
encode
,
int
maxByteLen
,
...
...
@@ -935,12 +888,9 @@ public class CommonFunctionUtils {
}
/**
* @param source
* 原始字符串
* @param maxByteLen
* 截取的字节数
* @param flag
* 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
* @param source 原始字符串
* @param maxByteLen 截取的字节数
* @param flag 表示处理汉字的方式。1表示遇到半个汉字时补全,-1表示遇到半个汉字时舍弃
* @return 截取后的字符串
* @throws UnsupportedEncodingException
**/
...
...
@@ -1016,18 +966,18 @@ public class CommonFunctionUtils {
}
// 解析GTP使用的映射
private
static
String
[][]
unpackRuleMappings
=
new
String
[][]
{
{
"\\\\\\\\"
,
"__backslash__"
,
"\\\\"
},
{
"\\\\="
,
"__equal__"
,
"="
},
{
"\\\\\\["
,
"__leftbracket__"
,
"["
},
{
"\\\\]"
,
"__rightbracket__"
,
"]"
},
{
"\\\\\\{"
,
"__leftbrace__"
,
"{"
},
{
"\\\\}"
,
"__rightbrace__"
,
"}"
},
{
"\\\\,"
,
"__comma__"
,
","
}
};
private
static
String
[][]
unpackRuleMappings
=
new
String
[][]
{
{
"\\\\\\\\"
,
"__backslash__"
,
"\\\\"
},
{
"\\\\="
,
"__equal__"
,
"="
},
{
"\\\\\\["
,
"__leftbracket__"
,
"["
},
{
"\\\\]"
,
"__rightbracket__"
,
"]"
},
{
"\\\\\\{"
,
"__leftbrace__"
,
"{"
},
{
"\\\\}"
,
"__rightbrace__"
,
"}"
},
{
"\\\\,"
,
"__comma__"
,
","
}
};
// 组装GTP使用的映射
private
static
String
[][]
packRuleMappings
=
new
String
[][]
{
{
"\\\\"
,
"\\\\\\\\"
},
{
"="
,
"\\\\="
},
{
"\\["
,
"\\\\["
},
{
"]"
,
"\\\\]"
},
{
"\\{"
,
"\\\\{"
},
{
"}"
,
"\\\\}"
},
{
","
,
"\\\\,"
}
};
private
static
String
[][]
packRuleMappings
=
new
String
[][]
{
{
"\\\\"
,
"\\\\\\\\"
},
{
"="
,
"\\\\="
},
{
"\\["
,
"\\\\["
},
{
"]"
,
"\\\\]"
},
{
"\\{"
,
"\\\\{"
},
{
"}"
,
"\\\\}"
},
{
","
,
"\\\\,"
}
};
public
static
Map
gtpToMap
(
String
str
)
{
...
...
@@ -1353,10 +1303,10 @@ public class CommonFunctionUtils {
String
[]
interval
=
times
[
i
].
split
(
"\\-"
);
if
(
interval
.
length
==
2
)
{
if
(
interval
[
0
].
compareTo
(
interval
[
1
])
>=
0
)
{
tmp
.
add
(
new
String
[]
{
interval
[
0
],
"24:00"
});
tmp
.
add
(
new
String
[]
{
"00:00"
,
interval
[
1
]
});
tmp
.
add
(
new
String
[]{
interval
[
0
],
"24:00"
});
tmp
.
add
(
new
String
[]{
"00:00"
,
interval
[
1
]
});
}
else
{
tmp
.
add
(
new
String
[]
{
interval
[
0
],
interval
[
1
]
});
tmp
.
add
(
new
String
[]{
interval
[
0
],
interval
[
1
]
});
}
}
...
...
@@ -1413,16 +1363,16 @@ public class CommonFunctionUtils {
if
(
diffTime
==
0
)
{
if
(
next
.
equals
(
"00:00"
))
next
=
"24:00"
;
result
.
add
(
new
String
[]
{
start
,
next
});
result
.
add
(
new
String
[]{
start
,
next
});
return
diffTime
;
}
if
(
diffTime
>
0
)
{
result
.
add
(
new
String
[]
{
start
,
null
});
result
.
add
(
new
String
[]{
start
,
null
});
}
else
{
if
(
next
.
equals
(
"00:00"
))
next
=
"24:00"
;
result
.
add
(
new
String
[]
{
start
,
next
});
result
.
add
(
new
String
[]{
start
,
next
});
diffTime
=
loopTimelot
(
result
,
next
,
end
,
pattern
,
type
);
}
...
...
@@ -1512,14 +1462,10 @@ public class CommonFunctionUtils {
/**
* 提炼FileConnection的写文件功能
*
* @param content
* 待写入文件的内容,可以是字节数组或者字符串
* @param path
* 文件路径
* @param append
* 是追加写到文件末尾还是从文件开始处写
* @param encode
* 文件内容编码
* @param content 待写入文件的内容,可以是字节数组或者字符串
* @param path 文件路径
* @param append 是追加写到文件末尾还是从文件开始处写
* @param encode 文件内容编码
*/
public
static
void
writeFile
(
Object
content
,
String
path
,
boolean
append
,
String
encode
)
{
...
...
@@ -1715,12 +1661,9 @@ public class CommonFunctionUtils {
/**
* 由XML元素获取XML字符串
*
* @param element
* XML元素
* @param indent
* 缩进填充字符串
* @param newlines
* 是否折行
* @param element XML元素
* @param indent 缩进填充字符串
* @param newlines 是否折行
* @return XML字符串
*/
public
static
String
Stringize
(
Element
element
,
String
indent
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment