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
6088b120
Commit
6088b120
authored
Jul 12, 2022
by
s_guodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
7409e0ce
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
56 additions
and
190 deletions
+56
-190
ApiUtil.java
src/main/extutil/com/brilliance/ext/util/ApiUtil.java
+5
-5
CfcaMsg.java
src/main/extutil/com/brilliance/ext/util/CfcaMsg.java
+2
-2
ExcelUtil.java
src/main/extutil/com/brilliance/ext/util/ExcelUtil.java
+2
-2
MTUnPackMessage.java
src/main/extutil/com/brilliance/swift/MTUnPackMessage.java
+2
-2
ParseConfig.java
src/main/src/com/brilliance/eibs/bean/ParseConfig.java
+5
-5
AbsFilter.java
...brilliance/eibs/core/service/instance/impl/AbsFilter.java
+2
-2
ApacheJexl.java
src/main/src/com/brilliance/eibs/el/ApacheJexl.java
+3
-3
CommonUtil.java
src/main/src/com/brilliance/eibs/el/CommonUtil.java
+0
-134
FilesWatchdog.java
.../brilliance/eibs/listener/helpers/impl/FilesWatchdog.java
+5
-5
Client.java
src/main/src/com/brilliance/eibs/main/Client.java
+3
-3
Server.java
src/main/src/com/brilliance/eibs/main/Server.java
+3
-3
ShortSocketHandle.java
...rc/com/brilliance/eibs/main/client/ShortSocketHandle.java
+3
-3
CronTask.java
src/main/src/com/brilliance/eibs/quartz/CronTask.java
+3
-3
HttpsService.java
src/main/src/com/brilliance/eibs/server/HttpsService.java
+2
-2
InitServer.java
src/main/src/com/brilliance/eibs/server/InitServer.java
+1
-1
Sqlite_OP.java
src/main/src/com/brilliance/eibs/sqlite/Sqlite_OP.java
+3
-3
ClassPathUpdater.java
src/main/src/com/brilliance/eibs/util/ClassPathUpdater.java
+2
-2
LogUtil.java
src/main/src/com/brilliance/eibs/util/LogUtil.java
+2
-2
NumberUtil.java
src/main/src/com/brilliance/eibs/util/NumberUtil.java
+2
-2
TemplateUtil.java
src/main/src/com/brilliance/eibs/util/TemplateUtil.java
+3
-3
XmlUtil.java
src/main/src/com/brilliance/eibs/util/XmlUtil.java
+3
-3
No files found.
src/main/extutil/com/brilliance/ext/util/ApiUtil.java
View file @
6088b120
...
@@ -10,7 +10,7 @@ import java.util.Map;
...
@@ -10,7 +10,7 @@ import java.util.Map;
import
org.apache.commons.collections.map.LinkedMap
;
import
org.apache.commons.collections.map.LinkedMap
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
public
class
ApiUtil
{
public
class
ApiUtil
{
...
@@ -51,7 +51,7 @@ public class ApiUtil {
...
@@ -51,7 +51,7 @@ public class ApiUtil {
File
f
=
new
File
(
dirpath
);
File
f
=
new
File
(
dirpath
);
String
[]
listFile
=
f
.
list
();
String
[]
listFile
=
f
.
list
();
for
(
int
i
=
0
;
i
<
listFile
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
listFile
.
length
;
i
++)
{
String
now
=
Common
Util
.
formatNow
(
"yy-MM-dd"
);
String
now
=
Common
FunctionUtils
.
formatNow
(
"yy-MM-dd"
);
// 文件名的1-9位
// 文件名的1-9位
String
fileHead
=
listFile
[
i
].
substring
(
1
,
9
);
String
fileHead
=
listFile
[
i
].
substring
(
1
,
9
);
if
(
fileHead
.
equals
(
now
))
{
if
(
fileHead
.
equals
(
now
))
{
...
@@ -64,8 +64,8 @@ public class ApiUtil {
...
@@ -64,8 +64,8 @@ public class ApiUtil {
public
static
List
<
String
>
sendpack
(
List
<
String
>
list
,
String
nowdate
,
int
set
)
throws
ParseException
{
public
static
List
<
String
>
sendpack
(
List
<
String
>
list
,
String
nowdate
,
int
set
)
throws
ParseException
{
List
<
String
>
liststr
=
new
ArrayList
<
String
>();
List
<
String
>
liststr
=
new
ArrayList
<
String
>();
Date
date
=
Common
Util
.
dateAdd
(
CommonUtil
.
parseDate
(
nowdate
,
"MM-dd HH:mm:ss"
),
1
,
set
);
Date
date
=
Common
FunctionUtils
.
dateAdd
(
CommonFunctionUtils
.
parseDate
(
nowdate
,
"MM-dd HH:mm:ss"
),
1
,
set
);
String
logdate
=
Common
Util
.
format
(
date
,
"MM-dd HH:mm:ss"
);
String
logdate
=
Common
FunctionUtils
.
format
(
date
,
"MM-dd HH:mm:ss"
);
// System.out.println("logdate=" + logdate);
// System.out.println("logdate=" + logdate);
for
(
String
logstr
:
list
)
{
for
(
String
logstr
:
list
)
{
String
loghead
=
logstr
.
substring
(
1
,
15
);
String
loghead
=
logstr
.
substring
(
1
,
15
);
...
@@ -84,7 +84,7 @@ public class ApiUtil {
...
@@ -84,7 +84,7 @@ public class ApiUtil {
list
.
add
(
"[09-02 19:28:57]:所有回报:0857APINAME=onRecvDeferQuotation#DATATYPE=TDeferQuotation^instID=Ag(T+D)^name=白银延期^lastSettle=3362.000000^lastClose=3355.000000^open=3352.000000^high=3365.000000^low=3339.000000^last=3362.000000^close=0.000000^settle=0.000000^bid1=3361.000000^bidLot1=899^bid2=3360.000000^bidLot2=22^bid3=3359.000000^bidLot3=17^bid4=3358.000000^bidLot4=98^bid5=3357.000000^bidLot5=33^ask1=3362.000000^askLot1=164^ask2=3363.000000^askLot2=257^ask3=3364.000000^askLot3=335^ask4=3365.000000^askLot4=3701^ask5=3366.000000^askLot5=917^volume=334752^weight=334752.000000^highLimit=3630.000000^lowLimit=3093.000000^Posi=5403802^upDown=0.000000^upDownRate=0.000000^turnOver=1123360354.000000^average=3355.000000^quoteDate=20160328^quoteTime=02:25:23^sequenceNo=36202^#DATATYPE=TTRspMsg^Flag=L^RspCode=RSP000000^RspMsg=交易成功^#DATATYPE=String^val=^#"
);
list
.
add
(
"[09-02 19:28:57]:所有回报:0857APINAME=onRecvDeferQuotation#DATATYPE=TDeferQuotation^instID=Ag(T+D)^name=白银延期^lastSettle=3362.000000^lastClose=3355.000000^open=3352.000000^high=3365.000000^low=3339.000000^last=3362.000000^close=0.000000^settle=0.000000^bid1=3361.000000^bidLot1=899^bid2=3360.000000^bidLot2=22^bid3=3359.000000^bidLot3=17^bid4=3358.000000^bidLot4=98^bid5=3357.000000^bidLot5=33^ask1=3362.000000^askLot1=164^ask2=3363.000000^askLot2=257^ask3=3364.000000^askLot3=335^ask4=3365.000000^askLot4=3701^ask5=3366.000000^askLot5=917^volume=334752^weight=334752.000000^highLimit=3630.000000^lowLimit=3093.000000^Posi=5403802^upDown=0.000000^upDownRate=0.000000^turnOver=1123360354.000000^average=3355.000000^quoteDate=20160328^quoteTime=02:25:23^sequenceNo=36202^#DATATYPE=TTRspMsg^Flag=L^RspCode=RSP000000^RspMsg=交易成功^#DATATYPE=String^val=^#"
);
list
.
add
(
"[09-02 19:28:58]:所有回1报:0858APINAME=onRecvDeferQuotation#DATATYPE=TDeferQuotation^instID=Ag(T+D)^name=白银延期^lastSettle=3362.000000^lastClose=3355.000000^open=3352.000000^high=3365.000000^low=3339.000000^last=3362.000000^close=0.000000^settle=0.000000^bid1=3361.000000^bidLot1=899^bid2=3360.000000^bidLot2=22^bid3=3359.000000^bidLot3=17^bid4=3358.000000^bidLot4=98^bid5=3357.000000^bidLot5=33^ask1=3362.000000^askLot1=164^ask2=3363.000000^askLot2=257^ask3=3364.000000^askLot3=335^ask4=3365.000000^askLot4=3701^ask5=3366.000000^askLot5=917^volume=334752^weight=334752.000000^highLimit=3630.000000^lowLimit=3093.000000^Posi=5403802^upDown=0.000000^upDownRate=0.000000^turnOver=1123360354.000000^average=3355.000000^quoteDate=20160328^quoteTime=02:25:23^sequenceNo=36202^#DATATYPE=TTRspMsg^Flag=L^RspCode=RSP000000^RspMsg=交易成功^#DATATYPE=String^val=^#"
);
list
.
add
(
"[09-02 19:28:58]:所有回1报:0858APINAME=onRecvDeferQuotation#DATATYPE=TDeferQuotation^instID=Ag(T+D)^name=白银延期^lastSettle=3362.000000^lastClose=3355.000000^open=3352.000000^high=3365.000000^low=3339.000000^last=3362.000000^close=0.000000^settle=0.000000^bid1=3361.000000^bidLot1=899^bid2=3360.000000^bidLot2=22^bid3=3359.000000^bidLot3=17^bid4=3358.000000^bidLot4=98^bid5=3357.000000^bidLot5=33^ask1=3362.000000^askLot1=164^ask2=3363.000000^askLot2=257^ask3=3364.000000^askLot3=335^ask4=3365.000000^askLot4=3701^ask5=3366.000000^askLot5=917^volume=334752^weight=334752.000000^highLimit=3630.000000^lowLimit=3093.000000^Posi=5403802^upDown=0.000000^upDownRate=0.000000^turnOver=1123360354.000000^average=3355.000000^quoteDate=20160328^quoteTime=02:25:23^sequenceNo=36202^#DATATYPE=TTRspMsg^Flag=L^RspCode=RSP000000^RspMsg=交易成功^#DATATYPE=String^val=^#"
);
list
.
add
(
"[09-02 19:28:59]:所有回报:0859APINAME=onRecvDeferQuotation#DATATYPE=TDeferQuotation^instID=Ag(T+D)^name=白银延期^lastSettle=3362.000000^lastClose=3355.000000^open=3352.000000^high=3365.000000^low=3339.000000^last=3362.000000^close=0.000000^settle=0.000000^bid1=3361.000000^bidLot1=899^bid2=3360.000000^bidLot2=22^bid3=3359.000000^bidLot3=17^bid4=3358.000000^bidLot4=98^bid5=3357.000000^bidLot5=33^ask1=3362.000000^askLot1=164^ask2=3363.000000^askLot2=257^ask3=3364.000000^askLot3=335^ask4=3365.000000^askLot4=3701^ask5=3366.000000^askLot5=917^volume=334752^weight=334752.000000^highLimit=3630.000000^lowLimit=3093.000000^Posi=5403802^upDown=0.000000^upDownRate=0.000000^turnOver=1123360354.000000^average=3355.000000^quoteDate=20160328^quoteTime=02:25:23^sequenceNo=36202^#DATATYPE=TTRspMsg^Flag=L^RspCode=RSP000000^RspMsg=交易成功^#DATATYPE=String^val=^#"
);
list
.
add
(
"[09-02 19:28:59]:所有回报:0859APINAME=onRecvDeferQuotation#DATATYPE=TDeferQuotation^instID=Ag(T+D)^name=白银延期^lastSettle=3362.000000^lastClose=3355.000000^open=3352.000000^high=3365.000000^low=3339.000000^last=3362.000000^close=0.000000^settle=0.000000^bid1=3361.000000^bidLot1=899^bid2=3360.000000^bidLot2=22^bid3=3359.000000^bidLot3=17^bid4=3358.000000^bidLot4=98^bid5=3357.000000^bidLot5=33^ask1=3362.000000^askLot1=164^ask2=3363.000000^askLot2=257^ask3=3364.000000^askLot3=335^ask4=3365.000000^askLot4=3701^ask5=3366.000000^askLot5=917^volume=334752^weight=334752.000000^highLimit=3630.000000^lowLimit=3093.000000^Posi=5403802^upDown=0.000000^upDownRate=0.000000^turnOver=1123360354.000000^average=3355.000000^quoteDate=20160328^quoteTime=02:25:23^sequenceNo=36202^#DATATYPE=TTRspMsg^Flag=L^RspCode=RSP000000^RspMsg=交易成功^#DATATYPE=String^val=^#"
);
String
now
=
Common
Util
.
formatNow
(
"MM-dd HH:mm:ss"
);
String
now
=
Common
FunctionUtils
.
formatNow
(
"MM-dd HH:mm:ss"
);
System
.
out
.
println
(
sendpack
(
list
,
"09-02 19:28:59"
,
-
1
));
System
.
out
.
println
(
sendpack
(
list
,
"09-02 19:28:59"
,
-
1
));
}
}
...
...
src/main/extutil/com/brilliance/ext/util/CfcaMsg.java
View file @
6088b120
...
@@ -7,7 +7,7 @@ import java.net.URL;
...
@@ -7,7 +7,7 @@ import java.net.URL;
import
java.util.zip.GZIPInputStream
;
import
java.util.zip.GZIPInputStream
;
import
java.util.zip.GZIPOutputStream
;
import
java.util.zip.GZIPOutputStream
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.util.StringUtil
;
import
com.brilliance.eibs.util.StringUtil
;
import
com.cfca.util.pki.api.CertUtil
;
import
com.cfca.util.pki.api.CertUtil
;
import
com.cfca.util.pki.api.EncryptUtil
;
import
com.cfca.util.pki.api.EncryptUtil
;
...
@@ -47,7 +47,7 @@ public class CfcaMsg {
...
@@ -47,7 +47,7 @@ public class CfcaMsg {
URL
url
=
Thread
.
currentThread
().
getContextClassLoader
()
URL
url
=
Thread
.
currentThread
().
getContextClassLoader
()
.
getResource
(
relativePath
);
.
getResource
(
relativePath
);
if
(
url
==
null
)
{
if
(
url
==
null
)
{
url
=
Common
Util
.
class
.
getClassLoader
().
getResource
(
url
=
Common
FunctionUtils
.
class
.
getClassLoader
().
getResource
(
relativePath
);
relativePath
);
}
}
return
url
;
return
url
;
...
...
src/main/extutil/com/brilliance/ext/util/ExcelUtil.java
View file @
6088b120
...
@@ -21,7 +21,7 @@ import org.apache.poi.ss.usermodel.Sheet;
...
@@ -21,7 +21,7 @@ import org.apache.poi.ss.usermodel.Sheet;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.util.LogUtil
;
import
com.brilliance.eibs.util.LogUtil
;
import
com.brilliance.eibs.util.StringUtil
;
import
com.brilliance.eibs.util.StringUtil
;
...
@@ -492,7 +492,7 @@ public class ExcelUtil {
...
@@ -492,7 +492,7 @@ public class ExcelUtil {
if
(
newValue
.
trim
().
length
()
==
8
)
{
if
(
newValue
.
trim
().
length
()
==
8
)
{
newValue
=
newValue
.
substring
(
0
,
4
)
+
"/"
+
newValue
.
substring
(
4
,
6
)
+
"/"
+
newValue
.
substring
(
6
,
8
);
newValue
=
newValue
.
substring
(
0
,
4
)
+
"/"
+
newValue
.
substring
(
4
,
6
)
+
"/"
+
newValue
.
substring
(
6
,
8
);
}
}
newCell
.
setCellValue
(
Common
Util
.
parseDate
(
newValue
,
"yyy/MM/dd"
));
newCell
.
setCellValue
(
Common
FunctionUtils
.
parseDate
(
newValue
,
"yyy/MM/dd"
));
}
}
}
}
...
...
src/main/extutil/com/brilliance/swift/MTUnPackMessage.java
View file @
6088b120
...
@@ -630,8 +630,8 @@ public class MTUnPackMessage extends AbstractMTPackMessage {
...
@@ -630,8 +630,8 @@ public class MTUnPackMessage extends AbstractMTPackMessage {
// String pyr=tmp.get("50K");
// String pyr=tmp.get("50K");
// String[]PYRADRBLKS= getTwoLayerFiledVal(pyr);
// String[]PYRADRBLKS= getTwoLayerFiledVal(pyr);
// System.out.println(PYRADRBLKS[0]);
// System.out.println(PYRADRBLKS[0]);
// System.out.println(Common
Util
.toJson(tmp));
// System.out.println(Common
FunctionUtils
.toJson(tmp));
// System.out.println(Common
Util
.toJson(getSwfMsgInfo(filepath)));
// System.out.println(Common
FunctionUtils
.toJson(getSwfMsgInfo(filepath)));
// System.out.println(isContainFieldIn4(filepath,"52[A]"));
// System.out.println(isContainFieldIn4(filepath,"52[A]"));
// System.out.println(getFieldValIn4(filepath,"72"));
// System.out.println(getFieldValIn4(filepath,"72"));
// System.out.println(getTwoLayerFiledVal(tmp.get("59"))[1]);
// System.out.println(getTwoLayerFiledVal(tmp.get("59"))[1]);
...
...
src/main/src/com/brilliance/eibs/bean/ParseConfig.java
View file @
6088b120
...
@@ -3,7 +3,7 @@ package com.brilliance.eibs.bean;
...
@@ -3,7 +3,7 @@ package com.brilliance.eibs.bean;
import
com.brilliance.eibs.core.exception.InterfaceException
;
import
com.brilliance.eibs.core.exception.InterfaceException
;
import
com.brilliance.eibs.core.model.impl.ClassDef
;
import
com.brilliance.eibs.core.model.impl.ClassDef
;
import
com.brilliance.eibs.core.model.impl.ClassListDef
;
import
com.brilliance.eibs.core.model.impl.ClassListDef
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.util.ClassPathUpdater
;
import
com.brilliance.eibs.util.ClassPathUpdater
;
import
com.brilliance.eibs.util.Serializable2FileUtil
;
import
com.brilliance.eibs.util.Serializable2FileUtil
;
import
com.brilliance.eibs.util.StringUtil
;
import
com.brilliance.eibs.util.StringUtil
;
...
@@ -523,8 +523,8 @@ public class ParseConfig
...
@@ -523,8 +523,8 @@ public class ParseConfig
try
try
{
{
// String classpath = this.getClass().getClassLoader().getResource("").getFile() + path;
// String classpath = this.getClass().getClassLoader().getResource("").getFile() + path;
String
classpath
=
Common
Util
.
getCommonURL
(
""
).
getFile
()
+
path
;
String
classpath
=
Common
FunctionUtils
.
getCommonURL
(
""
).
getFile
()
+
path
;
classpath
=
Common
Util
.
decodeURL
(
classpath
);
classpath
=
Common
FunctionUtils
.
decodeURL
(
classpath
);
logger
.
debug
(
"buildpath="
+
classpath
);
logger
.
debug
(
"buildpath="
+
classpath
);
File
fp
=
new
File
(
buildpath
);
File
fp
=
new
File
(
buildpath
);
// 创建目录
// 创建目录
...
@@ -568,8 +568,8 @@ public class ParseConfig
...
@@ -568,8 +568,8 @@ public class ParseConfig
{
{
//String separeator=System.getProperty("file.separator");
//String separeator=System.getProperty("file.separator");
// String classpath = this.getClass().getClassLoader().getResource("").getFile() + path;
// String classpath = this.getClass().getClassLoader().getResource("").getFile() + path;
String
classpath
=
Common
Util
.
getCommonURL
(
""
).
getFile
()
+
path
;
String
classpath
=
Common
FunctionUtils
.
getCommonURL
(
""
).
getFile
()
+
path
;
classpath
=
Common
Util
.
decodeURL
(
classpath
);
classpath
=
Common
FunctionUtils
.
decodeURL
(
classpath
);
logger
.
debug
(
"classpath="
+
classpath
);
logger
.
debug
(
"classpath="
+
classpath
);
String
packagePath
=
bean
.
getPackageName
().
replace
(
"."
,
separator
);
String
packagePath
=
bean
.
getPackageName
().
replace
(
"."
,
separator
);
logger
.
debug
(
"packagePath="
+
packagePath
);
logger
.
debug
(
"packagePath="
+
packagePath
);
...
...
src/main/src/com/brilliance/eibs/core/service/instance/impl/AbsFilter.java
View file @
6088b120
...
@@ -13,7 +13,7 @@ import com.brilliance.eibs.core.service.instance.plugin.JdbcExecutor;
...
@@ -13,7 +13,7 @@ import com.brilliance.eibs.core.service.instance.plugin.JdbcExecutor;
import
com.brilliance.eibs.core.service.instance.plugin.SocketProxy
;
import
com.brilliance.eibs.core.service.instance.plugin.SocketProxy
;
import
com.brilliance.eibs.el.AbstractEL
;
import
com.brilliance.eibs.el.AbstractEL
;
import
com.brilliance.eibs.el.ApacheJexl
;
import
com.brilliance.eibs.el.ApacheJexl
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.factory.parser.XmlValidator
;
import
com.brilliance.eibs.factory.parser.XmlValidator
;
import
com.brilliance.eibs.sqlite.Sqlite_OP
;
import
com.brilliance.eibs.sqlite.Sqlite_OP
;
import
com.brilliance.eibs.util.*
;
import
com.brilliance.eibs.util.*
;
...
@@ -2091,7 +2091,7 @@ public abstract class AbsFilter implements IFilterInstance {
...
@@ -2091,7 +2091,7 @@ public abstract class AbsFilter implements IFilterInstance {
*/
*/
public
String
exchangeStr
(
String
rawstr
)
{
public
String
exchangeStr
(
String
rawstr
)
{
if
(
rawstr
.
startsWith
(
"0x"
))
{
if
(
rawstr
.
startsWith
(
"0x"
))
{
rawstr
=
new
String
(
Common
Util
.
parseHexStr2Byte
(
rawstr
.
replace
(
"0x"
,
""
)));
rawstr
=
new
String
(
Common
FunctionUtils
.
parseHexStr2Byte
(
rawstr
.
replace
(
"0x"
,
""
)));
}
else
{
}
else
{
rawstr
=
rawstr
.
replace
(
"\\r"
,
"\r"
).
replace
(
"\\n"
,
"\n"
).
replace
(
"\\t"
,
"\t"
);
rawstr
=
rawstr
.
replace
(
"\\r"
,
"\r"
).
replace
(
"\\n"
,
"\n"
).
replace
(
"\\t"
,
"\t"
);
}
}
...
...
src/main/src/com/brilliance/eibs/el/ApacheJexl.java
View file @
6088b120
...
@@ -48,8 +48,8 @@ public class ApacheJexl extends AbstractEL {
...
@@ -48,8 +48,8 @@ public class ApacheJexl extends AbstractEL {
try
{
try
{
// TODO 需要完善的代码
// TODO 需要完善的代码
// funcs.put(null,
// funcs.put(null,
// Class.forName("com.brilliance.eibs.el.Common
Util"));
// Class.forName("com.brilliance.eibs.el.Common
FunctionUtils"));CommonFunctionUtils
funcs
.
put
(
null
,
Thread
.
currentThread
().
getContextClassLoader
().
loadClass
(
"com.brilliance.eibs.el.Common
Util
"
));
funcs
.
put
(
null
,
Thread
.
currentThread
().
getContextClassLoader
().
loadClass
(
"com.brilliance.eibs.el.Common
FunctionUtils
"
));
Iterator
<
FunctionKey
>
it
=
funcMap
.
keySet
().
iterator
();
Iterator
<
FunctionKey
>
it
=
funcMap
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
while
(
it
.
hasNext
())
{
FunctionKey
fk
=
(
FunctionKey
)
it
.
next
();
FunctionKey
fk
=
(
FunctionKey
)
it
.
next
();
...
@@ -254,7 +254,7 @@ public class ApacheJexl extends AbstractEL {
...
@@ -254,7 +254,7 @@ public class ApacheJexl extends AbstractEL {
}
}
// 通用函数的处理
// 通用函数的处理
else
if
(
expression
.
matches
(
"[\\w]+\\([\\w\\W]*\\)"
))
{
else
if
(
expression
.
matches
(
"[\\w]+\\([\\w\\W]*\\)"
))
{
invokeStaticMethod
(
value
,
Common
Util
.
class
,
expression
,
context
);
invokeStaticMethod
(
value
,
Common
FunctionUtils
.
class
,
expression
,
context
);
}
else
if
(
expression
.
matches
(
"([\\w]+\\.[\\w]+)(\\([\\w\\W]*\\))"
))
{
}
else
if
(
expression
.
matches
(
"([\\w]+\\.[\\w]+)(\\([\\w\\W]*\\))"
))
{
String
objstr
=
getMatchedPortion
(
expression
,
"([\\w]+)\\.[\\w]+(\\([\\w\\W]*\\))"
,
1
);
String
objstr
=
getMatchedPortion
(
expression
,
"([\\w]+)\\.[\\w]+(\\([\\w\\W]*\\))"
,
1
);
invokeMethod
(
value
,
context
.
getVariable
(
objstr
),
expression
,
context
);
invokeMethod
(
value
,
context
.
getVariable
(
objstr
),
expression
,
context
);
...
...
src/main/src/com/brilliance/eibs/el/CommonUtil.java
deleted
100644 → 0
View file @
7409e0ce
package
com
.
brilliance
.
eibs
.
el
;
import
com.brilliance.eibs.util.ByteUtil
;
import
com.brilliance.eibs.util.DateUtil
;
import
com.brilliance.eibs.util.NumberUtil
;
import
com.google.gson.Gson
;
import
org.apache.commons.lang.time.DateUtils
;
import
javax.xml.datatype.XMLGregorianCalendar
;
import
java.io.File
;
import
java.io.UnsupportedEncodingException
;
import
java.net.MalformedURLException
;
import
java.net.URISyntaxException
;
import
java.net.URL
;
import
java.net.URLDecoder
;
import
java.text.ParseException
;
import
java.util.Date
;
/**
* @Description
* @Author s_guodong
* @Date 2022/6/30
*/
public
class
CommonUtil
{
public
static
String
decodeURL
(
String
path
)
{
try
{
return
URLDecoder
.
decode
(
path
,
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
}
return
null
;
}
public
static
URL
getCommonURL
(
String
relativePath
)
{
URL
url
=
Thread
.
currentThread
().
getContextClassLoader
()
.
getResource
(
relativePath
);
if
(
url
==
null
)
{
url
=
CommonUtil
.
class
.
getClassLoader
().
getResource
(
relativePath
);
if
(
url
==
null
)
{
url
=
CommonUtil
.
class
.
getClassLoader
()
.
getResource
(
""
);
try
{
return
new
URL
(
url
+
relativePath
);
}
catch
(
MalformedURLException
e
)
{
}
}
}
return
url
;
}
public
static
final
Date
dateAdd
(
Date
paramDate
,
int
paramInt1
,
int
paramInt2
)
{
return
DateUtil
.
dateAdd
(
paramDate
,
paramInt1
,
paramInt2
);
}
public
static
Date
parseDate
(
Date
date
,
String
parsePattern
)
throws
ParseException
{
return
DateUtil
.
parseDate
(
date
,
parsePattern
);
}
public
static
Date
parseDate
(
String
date
,
String
parsePattern
)
throws
ParseException
{
return
DateUtils
.
parseDate
(
date
,
new
String
[]
{
parsePattern
});
}
public
static
String
formatNow
()
{
return
DateUtil
.
formatNow
();
}
public
static
String
formatNow
(
String
pattern
)
{
return
DateUtil
.
formatNow
(
pattern
);
}
public
static
String
format
(
Date
date
)
{
return
DateUtil
.
format
(
date
);
}
public
static
String
format
(
Date
date
,
String
pattern
)
{
return
DateUtil
.
format
(
date
,
pattern
);
}
public
static
String
format
(
XMLGregorianCalendar
xgc
,
String
pattern
)
{
return
DateUtil
.
format
(
xgc
,
pattern
);
}
public
static
byte
[]
intToBytes
(
int
i
,
int
flg
)
{
return
ByteUtil
.
intToBytes
(
i
,
flg
);
}
public
static
byte
[]
intToBytes
(
int
i
)
{
return
ByteUtil
.
intToBytes
(
i
);
}
public
static
int
bytesToInt
(
byte
[]
bytes
)
{
return
ByteUtil
.
bytesToInt
(
bytes
);
}
public
static
String
decimalFormat2
(
Object
decimal
,
int
num
)
{
if
(
decimal
==
null
||
((
decimal
instanceof
String
)
&&
(
decimal
.
toString
().
trim
().
equals
(
""
))))
{
decimal
=
"0"
;
}
return
decimalFormat
(
decimal
,
num
);
}
public
static
String
decimalFormat
(
Object
decimal
,
int
num
)
{
return
NumberUtil
.
decimalFormat
(
decimal
,
num
);
}
public
static
byte
[]
parseHexStr2Byte
(
String
hexStr
)
{
return
ByteUtil
.
parseHexStr2Byte
(
hexStr
);
}
public
static
String
toJson
(
Object
obj
)
{
return
new
Gson
().
toJson
(
obj
);
}
/**
* 判断给定路径下的文件是否存在
*
* @return 存在返回文件路径,否则返回空
*/
public
static
String
getFilePath
(
String
filepth
)
{
File
f
=
null
;
try
{
f
=
new
File
(
getCommonURL
(
filepth
).
toURI
());
}
catch
(
URISyntaxException
e
)
{
return
null
;
}
return
f
==
null
?
null
:
f
.
exists
()
?
f
.
getPath
()
:
null
;
}
}
src/main/src/com/brilliance/eibs/listener/helpers/impl/FilesWatchdog.java
View file @
6088b120
package
com
.
brilliance
.
eibs
.
listener
.
helpers
.
impl
;
package
com
.
brilliance
.
eibs
.
listener
.
helpers
.
impl
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.factory.parser.impl.XmlParser
;
import
com.brilliance.eibs.factory.parser.impl.XmlParser
;
import
com.brilliance.eibs.listener.helpers.Watchdog
;
import
com.brilliance.eibs.listener.helpers.Watchdog
;
import
com.brilliance.eibs.server.manager.EibsServiceHandle
;
import
com.brilliance.eibs.server.manager.EibsServiceHandle
;
...
@@ -45,9 +45,9 @@ public abstract class FilesWatchdog extends Watchdog {
...
@@ -45,9 +45,9 @@ public abstract class FilesWatchdog extends Watchdog {
// 遍历所有监控文件或目录
// 遍历所有监控文件或目录
for
(
String
pathname
:
pathnames
)
{
for
(
String
pathname
:
pathnames
)
{
// url = this.getClass().getClassLoader().getResource(pathname);
// url = this.getClass().getClassLoader().getResource(pathname);
url
=
Common
Util
.
getCommonURL
(
pathname
);
url
=
Common
FunctionUtils
.
getCommonURL
(
pathname
);
if
(
url
!=
null
)
{
if
(
url
!=
null
)
{
file
=
new
File
(
Common
Util
.
decodeURL
(
url
.
getFile
()));
file
=
new
File
(
Common
FunctionUtils
.
decodeURL
(
url
.
getFile
()));
long
l
;
long
l
;
String
filename
;
String
filename
;
if
(
file
.
isDirectory
())
{
if
(
file
.
isDirectory
())
{
...
@@ -108,9 +108,9 @@ public abstract class FilesWatchdog extends Watchdog {
...
@@ -108,9 +108,9 @@ public abstract class FilesWatchdog extends Watchdog {
Map
<
String
,
List
<
String
>>
changedFileMap
=
new
HashMap
<
String
,
List
<
String
>>();
Map
<
String
,
List
<
String
>>
changedFileMap
=
new
HashMap
<
String
,
List
<
String
>>();
for
(
String
pathname
:
pathnames
)
{
for
(
String
pathname
:
pathnames
)
{
// URL url = this.getClass().getClassLoader().getResource(pathname);
// URL url = this.getClass().getClassLoader().getResource(pathname);
URL
url
=
Common
Util
.
getCommonURL
(
pathname
);
URL
url
=
Common
FunctionUtils
.
getCommonURL
(
pathname
);
if
(
url
!=
null
)
{
if
(
url
!=
null
)
{
File
file
=
new
File
(
Common
Util
.
decodeURL
(
url
.
getFile
()));
File
file
=
new
File
(
Common
FunctionUtils
.
decodeURL
(
url
.
getFile
()));
if
(
file
.
isDirectory
())
{
if
(
file
.
isDirectory
())
{
// 非主配置文件目录
// 非主配置文件目录
if
(!
pathname
.
equals
(
XmlParser
.
MAIN_PATH
))
{
if
(!
pathname
.
equals
(
XmlParser
.
MAIN_PATH
))
{
...
...
src/main/src/com/brilliance/eibs/main/Client.java
View file @
6088b120
...
@@ -12,7 +12,7 @@ import com.brilliance.eibs.core.service.instance.TransactionInstance;
...
@@ -12,7 +12,7 @@ import com.brilliance.eibs.core.service.instance.TransactionInstance;
import
com.brilliance.eibs.el.AbstractEL
;
import
com.brilliance.eibs.el.AbstractEL
;
import
com.brilliance.eibs.el.ApacheEL
;
import
com.brilliance.eibs.el.ApacheEL
;
import
com.brilliance.eibs.el.ApacheJexl
;
import
com.brilliance.eibs.el.ApacheJexl
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.factory.BeanFactory
;
import
com.brilliance.eibs.factory.BeanFactory
;
import
com.brilliance.eibs.factory.FactoryManager
;
import
com.brilliance.eibs.factory.FactoryManager
;
import
com.brilliance.eibs.factory.parser.ConfigParser
;
import
com.brilliance.eibs.factory.parser.ConfigParser
;
...
@@ -178,7 +178,7 @@ public class Client {
...
@@ -178,7 +178,7 @@ public class Client {
boolean
reload
=
false
;
boolean
reload
=
false
;
try
{
try
{
context
.
addVariable
(
"transaction"
,
Constants
.
Log_VAR
,
logger
);
context
.
addVariable
(
"transaction"
,
Constants
.
Log_VAR
,
logger
);
context
.
addVariable
(
"transaction"
,
Constants
.
DATE_VAR
,
Common
Util
.
format
(
new
Date
(),
"yyyyMMdd"
));
context
.
addVariable
(
"transaction"
,
Constants
.
DATE_VAR
,
Common
FunctionUtils
.
format
(
new
Date
(),
"yyyyMMdd"
));
BeanFactory
beanFactory
=
FactoryManager
.
getBeanFactory
();
BeanFactory
beanFactory
=
FactoryManager
.
getBeanFactory
();
// context.setBeanFactory(beanFactory);//设置上下文内存
// context.setBeanFactory(beanFactory);//设置上下文内存
...
@@ -393,7 +393,7 @@ public class Client {
...
@@ -393,7 +393,7 @@ public class Client {
boolean
reload
=
false
;
boolean
reload
=
false
;
try
{
try
{
context
.
addVariable
(
"transaction"
,
Constants
.
Log_VAR
,
logger
);
context
.
addVariable
(
"transaction"
,
Constants
.
Log_VAR
,
logger
);
context
.
addVariable
(
"transaction"
,
Constants
.
DATE_VAR
,
Common
Util
.
format
(
new
Date
(),
"yyyyMMdd"
));
context
.
addVariable
(
"transaction"
,
Constants
.
DATE_VAR
,
Common
FunctionUtils
.
format
(
new
Date
(),
"yyyyMMdd"
));
BeanFactory
beanFactory
=
FactoryManager
.
getBeanFactory
();
BeanFactory
beanFactory
=
FactoryManager
.
getBeanFactory
();
// context.setBeanFactory(beanFactory);//设置上下文内存
// context.setBeanFactory(beanFactory);//设置上下文内存
...
...
src/main/src/com/brilliance/eibs/main/Server.java
View file @
6088b120
...
@@ -6,7 +6,7 @@ import com.brilliance.eibs.core.model.IServiceDef;
...
@@ -6,7 +6,7 @@ import com.brilliance.eibs.core.model.IServiceDef;
import
com.brilliance.eibs.core.model.ITaskDef
;
import
com.brilliance.eibs.core.model.ITaskDef
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.el.ApacheEL
;
import
com.brilliance.eibs.el.ApacheEL
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.factory.BeanFactory
;
import
com.brilliance.eibs.factory.BeanFactory
;
import
com.brilliance.eibs.factory.FactoryManager
;
import
com.brilliance.eibs.factory.FactoryManager
;
import
com.brilliance.eibs.factory.parser.ConfigParser
;
import
com.brilliance.eibs.factory.parser.ConfigParser
;
...
@@ -533,8 +533,8 @@ public class Server {
...
@@ -533,8 +533,8 @@ public class Server {
// Thread.currentThread().getContextClassLoader().getResource("").getPath()
// Thread.currentThread().getContextClassLoader().getResource("").getPath()
// + "/" +
// + "/" +
// PID_FILE_NAME;
// PID_FILE_NAME;
String
path
=
Common
Util
.
getCommonURL
(
""
).
getPath
()
+
"/"
+
PID_FILE_NAME
;
String
path
=
Common
FunctionUtils
.
getCommonURL
(
""
).
getPath
()
+
"/"
+
PID_FILE_NAME
;
path
=
Common
Util
.
decodeURL
(
path
);
path
=
Common
FunctionUtils
.
decodeURL
(
path
);
File
file
=
new
File
(
path
);
File
file
=
new
File
(
path
);
if
(!
file
.
getParentFile
().
exists
())
{
if
(!
file
.
getParentFile
().
exists
())
{
file
.
getParentFile
().
mkdirs
();
file
.
getParentFile
().
mkdirs
();
...
...
src/main/src/com/brilliance/eibs/main/client/ShortSocketHandle.java
View file @
6088b120
...
@@ -2,7 +2,7 @@ package com.brilliance.eibs.main.client;
...
@@ -2,7 +2,7 @@ package com.brilliance.eibs.main.client;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.ResultMsg
;
import
com.brilliance.eibs.core.service.ResultMsg
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.main.Client
;
import
com.brilliance.eibs.main.Client
;
import
com.brilliance.eibs.server.IServerInstance
;
import
com.brilliance.eibs.server.IServerInstance
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
...
@@ -66,7 +66,7 @@ public class ShortSocketHandle implements Runnable {
...
@@ -66,7 +66,7 @@ public class ShortSocketHandle implements Runnable {
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_10
))
{
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_10
))
{
headLen
=
Integer
.
parseInt
(
new
String
(
headLenBytes
));
headLen
=
Integer
.
parseInt
(
new
String
(
headLenBytes
));
}
else
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_2
))
{
}
else
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_2
))
{
headLen
=
Common
Util
.
bytesToInt
(
headLenBytes
);
headLen
=
Common
FunctionUtils
.
bytesToInt
(
headLenBytes
);
}
}
if
(
is_contain_head_len
)
{
if
(
is_contain_head_len
)
{
headLen
=
headLen
-
head_len
;
headLen
=
headLen
-
head_len
;
...
@@ -103,7 +103,7 @@ public class ShortSocketHandle implements Runnable {
...
@@ -103,7 +103,7 @@ public class ShortSocketHandle implements Runnable {
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_10
))
{
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_10
))
{
header
=
String
.
format
(
"%0"
+
head_len
+
"d"
,
returnLen
).
getBytes
();
header
=
String
.
format
(
"%0"
+
head_len
+
"d"
,
returnLen
).
getBytes
();
}
else
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_2
))
{
}
else
if
(
head_len_type
.
equals
(
IServerInstance
.
HEAD_LEN_TYPE_2
))
{
header
=
Common
Util
.
intToBytes
(
returnLen
);
header
=
Common
FunctionUtils
.
intToBytes
(
returnLen
);
}
}
IOUtils
.
write
(
header
,
socket
.
getOutputStream
());
IOUtils
.
write
(
header
,
socket
.
getOutputStream
());
...
...
src/main/src/com/brilliance/eibs/quartz/CronTask.java
View file @
6088b120
...
@@ -5,7 +5,7 @@ import com.brilliance.eibs.core.model.IArgumentDef;
...
@@ -5,7 +5,7 @@ import com.brilliance.eibs.core.model.IArgumentDef;
import
com.brilliance.eibs.core.model.IPropertyDef
;
import
com.brilliance.eibs.core.model.IPropertyDef
;
import
com.brilliance.eibs.core.model.ITaskDef
;
import
com.brilliance.eibs.core.model.ITaskDef
;
import
com.brilliance.eibs.core.service.ResultMsg
;
import
com.brilliance.eibs.core.service.ResultMsg
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.main.Client
;
import
com.brilliance.eibs.main.Client
;
import
com.brilliance.eibs.util.StringUtil
;
import
com.brilliance.eibs.util.StringUtil
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
...
@@ -211,8 +211,8 @@ public class CronTask extends Thread {
...
@@ -211,8 +211,8 @@ public class CronTask extends Thread {
}
}
private
static
String
getPath
(
ITaskDef
taskDef
)
{
private
static
String
getPath
(
ITaskDef
taskDef
)
{
Date
date
=
Common
Util
.
dateAdd
(
new
Date
(),
4
,
Integer
.
parseInt
(
taskDef
.
getDate
()));
Date
date
=
Common
FunctionUtils
.
dateAdd
(
new
Date
(),
4
,
Integer
.
parseInt
(
taskDef
.
getDate
()));
String
filePath
=
Common
Util
.
getCommonURL
(
""
).
getPath
()
+
"/taskRecord/completed"
+
CommonUtil
.
format
(
date
,
"yyyyMMdd"
)
String
filePath
=
Common
FunctionUtils
.
getCommonURL
(
""
).
getPath
()
+
"/taskRecord/completed"
+
CommonFunctionUtils
.
format
(
date
,
"yyyyMMdd"
)
+
".txt"
;
+
".txt"
;
return
filePath
;
return
filePath
;
}
}
...
...
src/main/src/com/brilliance/eibs/server/HttpsService.java
View file @
6088b120
...
@@ -5,7 +5,7 @@ import com.brilliance.eibs.core.exception.InterfaceException;
...
@@ -5,7 +5,7 @@ import com.brilliance.eibs.core.exception.InterfaceException;
import
com.brilliance.eibs.core.model.IServiceDef
;
import
com.brilliance.eibs.core.model.IServiceDef
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.el.ApacheEL
;
import
com.brilliance.eibs.el.ApacheEL
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.main.Client
;
import
com.brilliance.eibs.main.Client
;
import
com.sun.net.httpserver.*
;
import
com.sun.net.httpserver.*
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
...
@@ -87,7 +87,7 @@ public class HttpsService extends AbsServer {
...
@@ -87,7 +87,7 @@ public class HttpsService extends AbsServer {
if
(
rtnVal
instanceof
String
)
{
if
(
rtnVal
instanceof
String
)
{
response
(
httpExchange
,
(
String
)
rtnVal
,
encode
);
response
(
httpExchange
,
(
String
)
rtnVal
,
encode
);
}
else
{
}
else
{
response
(
httpExchange
,
Common
Util
.
toJson
(
rtnVal
),
encode
);
response
(
httpExchange
,
Common
FunctionUtils
.
toJson
(
rtnVal
),
encode
);
}
}
return
;
return
;
}
}
...
...
src/main/src/com/brilliance/eibs/server/InitServer.java
View file @
6088b120
...
@@ -45,7 +45,7 @@ public class InitServer extends AbsServer {
...
@@ -45,7 +45,7 @@ public class InitServer extends AbsServer {
public
void
call
(
String
interfaceName
,
String
transName
)
{
public
void
call
(
String
interfaceName
,
String
transName
)
{
/*
/*
* try { Common
Util
.sleep(10000); } catch (InterruptedException
* try { Common
FunctionUtils
.sleep(10000); } catch (InterruptedException
* e) { // TODO Auto-generated catch block e.printStackTrace(); }
* e) { // TODO Auto-generated catch block e.printStackTrace(); }
*/
*/
...
...
src/main/src/com/brilliance/eibs/sqlite/Sqlite_OP.java
View file @
6088b120
...
@@ -7,7 +7,7 @@ import java.sql.ResultSet;
...
@@ -7,7 +7,7 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.util.StringUtil
;
import
com.brilliance.eibs.util.StringUtil
;
/**
/**
...
@@ -27,10 +27,10 @@ public class Sqlite_OP {
...
@@ -27,10 +27,10 @@ public class Sqlite_OP {
try
{
try
{
Class
.
forName
(
"org.sqlite.JDBC"
);
Class
.
forName
(
"org.sqlite.JDBC"
);
// URL url = getClass().getClassLoader().getResource(str);
// URL url = getClass().getClassLoader().getResource(str);
URL
url
=
Common
Util
.
getCommonURL
(
str
);
URL
url
=
Common
FunctionUtils
.
getCommonURL
(
str
);
// String path = url.getPath();
// String path = url.getPath();
String
path
=
url
.
toExternalForm
();
String
path
=
url
.
toExternalForm
();
path
=
Common
Util
.
decodeURL
(
path
);
path
=
Common
FunctionUtils
.
decodeURL
(
path
);
// System.out.println("path=" + url.getPath());
// System.out.println("path=" + url.getPath());
// System.out.println("externalForm=" + path);
// System.out.println("externalForm=" + path);
String
os
=
System
.
getProperty
(
"os.name"
);
String
os
=
System
.
getProperty
(
"os.name"
);
...
...
src/main/src/com/brilliance/eibs/util/ClassPathUpdater.java
View file @
6088b120
package
com
.
brilliance
.
eibs
.
util
;
package
com
.
brilliance
.
eibs
.
util
;
import
com.brilliance.eibs.bean.ParseConfig
;
import
com.brilliance.eibs.bean.ParseConfig
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
java.io.File
;
import
java.io.File
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.InvocationTargetException
;
...
@@ -82,7 +82,7 @@ public class ClassPathUpdater {
...
@@ -82,7 +82,7 @@ public class ClassPathUpdater {
// return
// return
// URLDecoder.decode(Thread.currentThread().getContextClassLoader().getResource("").toURI().getPath()
// URLDecoder.decode(Thread.currentThread().getContextClassLoader().getResource("").toURI().getPath()
// + file, "utf-8");
// + file, "utf-8");
return
Common
Util
.
decodeURL
(
CommonUtil
.
getCommonURL
(
""
).
getPath
()
+
file
);
return
Common
FunctionUtils
.
decodeURL
(
CommonFunctionUtils
.
getCommonURL
(
""
).
getPath
()
+
file
);
/*
/*
* catch (URISyntaxException e) { throw new RuntimeException("URI error.", e); }
* catch (URISyntaxException e) { throw new RuntimeException("URI error.", e); }
*/
*/
...
...
src/main/src/com/brilliance/eibs/util/LogUtil.java
View file @
6088b120
package
com
.
brilliance
.
eibs
.
util
;
package
com
.
brilliance
.
eibs
.
util
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.util.logging.AbstractLoggingFrame
;
import
com.brilliance.eibs.util.logging.AbstractLoggingFrame
;
import
com.brilliance.eibs.util.logging.LoggingFrame
;
import
com.brilliance.eibs.util.logging.LoggingFrame
;
import
com.brilliance.eibs.util.logging.log4j.Log4JLoggingFrame
;
import
com.brilliance.eibs.util.logging.log4j.Log4JLoggingFrame
;
...
@@ -29,7 +29,7 @@ public class LogUtil {
...
@@ -29,7 +29,7 @@ public class LogUtil {
public
static
final
String
LOG_PATH
=
"log"
;
public
static
final
String
LOG_PATH
=
"log"
;
public
static
final
String
LOG_FILE_NAME_SYMBOL
=
"interface_id"
;
public
static
final
String
LOG_FILE_NAME_SYMBOL
=
"interface_id"
;
public
static
boolean
mode
=
false
;
public
static
boolean
mode
=
false
;
public
static
final
String
ROOT_PATH
=
Common
Util
.
getFilePath
(
""
)
+
"/"
;
public
static
final
String
ROOT_PATH
=
Common
FunctionUtils
.
getFilePath
(
""
)
+
"/"
;
public
static
final
String
LOG_MODE
=
PropertyUtil
.
getProperty
(
"sys.properties"
,
"LOGMODE"
);
public
static
final
String
LOG_MODE
=
PropertyUtil
.
getProperty
(
"sys.properties"
,
"LOGMODE"
);
static
{
static
{
...
...
src/main/src/com/brilliance/eibs/util/NumberUtil.java
View file @
6088b120
package
com
.
brilliance
.
eibs
.
util
;
package
com
.
brilliance
.
eibs
.
util
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
...
@@ -78,7 +78,7 @@ public class NumberUtil {
...
@@ -78,7 +78,7 @@ public class NumberUtil {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
Common
Util
.
decimalFormat2
(
null
,
2
));
System
.
out
.
println
(
Common
FunctionUtils
.
decimalFormat2
(
null
,
2
));
String
a
=
"0.3849999999996"
;
String
a
=
"0.3849999999996"
;
System
.
out
.
println
(
NumberUtil
.
round
(
Double
.
valueOf
(
a
),
5
));
System
.
out
.
println
(
NumberUtil
.
round
(
Double
.
valueOf
(
a
),
5
));
...
...
src/main/src/com/brilliance/eibs/util/TemplateUtil.java
View file @
6088b120
package
com
.
brilliance
.
eibs
.
util
;
package
com
.
brilliance
.
eibs
.
util
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.velocity.Template
;
import
org.apache.velocity.Template
;
import
org.apache.velocity.VelocityContext
;
import
org.apache.velocity.VelocityContext
;
...
@@ -17,7 +17,7 @@ import java.util.Map;
...
@@ -17,7 +17,7 @@ import java.util.Map;
public
class
TemplateUtil
{
public
class
TemplateUtil
{
public
static
void
makeFileByTemplate
(
String
template
,
Map
<
String
,
Object
>
cache
,
String
outPut
,
String
encode
)
throws
IOException
{
public
static
void
makeFileByTemplate
(
String
template
,
Map
<
String
,
Object
>
cache
,
String
outPut
,
String
encode
)
throws
IOException
{
ClassLoader
classLoader
=
Common
Util
.
class
.
getClassLoader
();
ClassLoader
classLoader
=
Common
FunctionUtils
.
class
.
getClassLoader
();
URL
url
=
classLoader
.
getResource
(
"template/"
);
URL
url
=
classLoader
.
getResource
(
"template/"
);
if
(
url
!=
null
)
{
if
(
url
!=
null
)
{
VelocityEngine
ve
=
new
VelocityEngine
();
VelocityEngine
ve
=
new
VelocityEngine
();
...
@@ -37,7 +37,7 @@ public class TemplateUtil {
...
@@ -37,7 +37,7 @@ public class TemplateUtil {
}
}
public
static
void
makeFileByTemplate2
(
String
template
,
Map
<
String
,
Object
>
cache
,
String
outPut
,
String
encode
)
throws
IOException
{
public
static
void
makeFileByTemplate2
(
String
template
,
Map
<
String
,
Object
>
cache
,
String
outPut
,
String
encode
)
throws
IOException
{
ClassLoader
classLoader
=
Common
Util
.
class
.
getClassLoader
();
ClassLoader
classLoader
=
Common
FunctionUtils
.
class
.
getClassLoader
();
URL
url
=
classLoader
.
getResource
(
"template/"
);
URL
url
=
classLoader
.
getResource
(
"template/"
);
if
(
url
!=
null
)
{
if
(
url
!=
null
)
{
VelocityEngine
ve
=
new
VelocityEngine
();
VelocityEngine
ve
=
new
VelocityEngine
();
...
...
src/main/src/com/brilliance/eibs/util/XmlUtil.java
View file @
6088b120
...
@@ -5,7 +5,7 @@ import com.brilliance.eibs.core.model.IFieldDef;
...
@@ -5,7 +5,7 @@ import com.brilliance.eibs.core.model.IFieldDef;
import
com.brilliance.eibs.core.model.ISubfieldDef
;
import
com.brilliance.eibs.core.model.ISubfieldDef
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.Context
;
import
com.brilliance.eibs.core.service.instance.impl.AbsFilter
;
import
com.brilliance.eibs.core.service.instance.impl.AbsFilter
;
import
com.brilliance.eibs.el.Common
Util
;
import
com.brilliance.eibs.el.Common
FunctionUtils
;
import
com.brilliance.eibs.factory.parser.XmlValidator
;
import
com.brilliance.eibs.factory.parser.XmlValidator
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.filefilter.DirectoryFileFilter
;
import
org.apache.commons.io.filefilter.DirectoryFileFilter
;
...
@@ -43,7 +43,7 @@ public class XmlUtil {
...
@@ -43,7 +43,7 @@ public class XmlUtil {
**/
**/
public
static
Collection
<
File
>
getAllFile
(
String
path
)
{
public
static
Collection
<
File
>
getAllFile
(
String
path
)
{
URL
url
=
XmlUtil
.
getUrl
(
path
);
URL
url
=
XmlUtil
.
getUrl
(
path
);
File
srcfile
=
new
File
(
Common
Util
.
decodeURL
(
url
.
getPath
()));
File
srcfile
=
new
File
(
Common
FunctionUtils
.
decodeURL
(
url
.
getPath
()));
Collection
<
File
>
files
=
FileUtils
.
listFiles
(
srcfile
,
FileFilterUtils
.
suffixFileFilter
(
"xml"
),
DirectoryFileFilter
.
INSTANCE
);
Collection
<
File
>
files
=
FileUtils
.
listFiles
(
srcfile
,
FileFilterUtils
.
suffixFileFilter
(
"xml"
),
DirectoryFileFilter
.
INSTANCE
);
return
files
;
return
files
;
}
}
...
@@ -121,7 +121,7 @@ public class XmlUtil {
...
@@ -121,7 +121,7 @@ public class XmlUtil {
* @return
* @return
*/
*/
public
static
URL
getUrl
(
String
filepath
)
{
public
static
URL
getUrl
(
String
filepath
)
{
return
Common
Util
.
getCommonURL
(
filepath
);
return
Common
FunctionUtils
.
getCommonURL
(
filepath
);
}
}
/**
/**
...
...
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