From e1c51fec99c1196aa69f2a630c9ce706266ddbab Mon Sep 17 00:00:00 2001 From: SeanDragon <451482067@qq.com> Date: Mon, 8 Jan 2018 10:48:53 +0800 Subject: [PATCH 01/69] =?UTF-8?q?1=20=E4=BC=98=E5=8C=96=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pro/tools/system/ToolClassSearch.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common/src/main/java/pro/tools/system/ToolClassSearch.java b/common/src/main/java/pro/tools/system/ToolClassSearch.java index b1a71b7..66cf0c9 100644 --- a/common/src/main/java/pro/tools/system/ToolClassSearch.java +++ b/common/src/main/java/pro/tools/system/ToolClassSearch.java @@ -102,4 +102,19 @@ public static Set> getClazzByInterface(Class clazz) { return returnClassList; } + + public static Set> getClazzByParent(Class clazz) { + Set> returnClassList = new HashSet<>(); + + classSet.forEach(one -> { + if (clazz.isAssignableFrom(one)) { + // 本身加不进去 + if (!clazz.equals(one)) { + returnClassList.add(one); + } + } + }); + + return returnClassList; + } } From e30d9e9ca7699c99e7f201809e587aff78e402c8 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 12:30:10 +0800 Subject: [PATCH 02/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 9 +++++---- common/src/test/java/file/TestBasic.java | 5 ++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b1862f8..09bda74 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# pro.tools:protools:2.0 - -# future -1 在面向对象思想上思考更多,多线程场景深入思考 \ No newline at end of file +#common +#http +#mail +#security +#protool \ No newline at end of file diff --git a/common/src/test/java/file/TestBasic.java b/common/src/test/java/file/TestBasic.java index cda8f96..b29ae4b 100644 --- a/common/src/test/java/file/TestBasic.java +++ b/common/src/test/java/file/TestBasic.java @@ -2,7 +2,6 @@ import com.google.common.collect.Lists; import org.junit.Test; -import org.omg.Messaging.SYNC_WITH_TRANSPORT; import pro.tools.data.text.ToolJson; import pro.tools.data.text.ToolRandoms; import pro.tools.data.text.json.TypeBuilder; @@ -22,8 +21,8 @@ */ public class TestBasic { - public static final String fileName = "d:/2.txt"; - public static final String dirName = "d:/2"; + public static final Path fileName = Paths.get("d:/2.txt"); + public static final Path dirName = Paths.get("d:/2"); @Test public void testFileIs() { From b097e05751f48469e80ac63295b3373e5da3c7cf Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 12:30:42 +0800 Subject: [PATCH 03/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 09bda74..fa76653 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -#common -#http -#mail -#security -#protool \ No newline at end of file +# common +# http +# mail +# security +# protools \ No newline at end of file From d560cde3ac29051338bf765552cb2d93f02f3b53 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 12:51:34 +0800 Subject: [PATCH 04/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fa76653..817dc06 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # common +## 数据的处理、文件的处理、script 引擎的封装、系统方面查询的封装和日期对象的封装 # http +## 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) # mail +## 封装 JavaMail,并采用了队列等方法提高性能,并简化了发送过程 # security -# protools \ No newline at end of file +## 封装了 jdk 和 bouncycastle 中几十种常见加密方式 +# protools +## all 版本 \ No newline at end of file From cc534458b28a5bc58f5ea070f6ffdb9c341165ef Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 12:53:34 +0800 Subject: [PATCH 05/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 817dc06..95fe1bc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # common -## 数据的处理、文件的处理、script 引擎的封装、系统方面查询的封装和日期对象的封装 +## 数据的处理 +## 文件的处理 +## script 引擎的封装 +##系统方面查询的封装和日期对象的封装 # http ## 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) # mail From 1087436916ee294d051f829ec40f4b2f34ba5625 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 12:54:06 +0800 Subject: [PATCH 06/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95fe1bc..d7fec9e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## 数据的处理 ## 文件的处理 ## script 引擎的封装 -##系统方面查询的封装和日期对象的封装 +## 系统方面查询的封装和日期对象的封装 # http ## 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) # mail From 1cabe92265f5684dcd767973231080df8f1fef0c Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:00:33 +0800 Subject: [PATCH 07/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d7fec9e..2c18d1c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,23 @@ -# common -## 数据的处理 -## 文件的处理 -## script 引擎的封装 -## 系统方面查询的封装和日期对象的封装 -# http -## 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) -# mail -## 封装 JavaMail,并采用了队列等方法提高性能,并简化了发送过程 -# security -## 封装了 jdk 和 bouncycastle 中几十种常见加密方式 # protools -## all 版本 \ No newline at end of file +历经开发周期两年,并且应用过千万级别项目的工具箱 + +- [protools](#protools) + - [common](#common) + - [http](#common) + - [mail](#common) + - [security](#common) + - [protools](#all) + +## common +* 数据的处理 +* 文件的处理 +* script 引擎的封装 +* 系统方面查询的封装和日期对象的封装 +## http +* 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) +## mail +* 封装 JavaMail,并采用了队列等方法提高性能,并简化了发送过程 +## security +* 封装了 jdk 和 bouncycastle 中几十种常见加密方式 +## all +* all 版本 \ No newline at end of file From 50413385384ce3bcdb5087e86c6dd76c9ff7a3de Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:23:56 +0800 Subject: [PATCH 08/69] =?UTF-8?q?1=20clean=20install=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {protools => all}/pom.xml | 12 ++++++------ common/pom.xml | 4 ++-- http/pom.xml | 6 +++--- mail/pom.xml | 6 +++--- pom.xml | 12 +++--------- security/pom.xml | 6 +++--- 6 files changed, 20 insertions(+), 26 deletions(-) rename {protools => all}/pom.xml (90%) diff --git a/protools/pom.xml b/all/pom.xml similarity index 90% rename from protools/pom.xml rename to all/pom.xml index d0bc3a5..cadfcbe 100644 --- a/protools/pom.xml +++ b/all/pom.xml @@ -3,13 +3,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - parent + protools pro.tools - 2.0 + 3.0 4.0.0 - protools + all jar @@ -17,19 +17,19 @@ pro.tools http - 2.0 + 3.0 pro.tools mail - 2.0 + 3.0 pro.tools security - 2.0 + 3.0 diff --git a/common/pom.xml b/common/pom.xml index 6455312..a9897e5 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -3,9 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - parent + protools pro.tools - 2.0 + 3.0 4.0.0 diff --git a/http/pom.xml b/http/pom.xml index b556d7f..7270932 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -3,9 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - parent + protools pro.tools - 2.0 + 3.0 4.0.0 @@ -15,7 +15,7 @@ pro.tools common - 2.0 + 3.0 diff --git a/mail/pom.xml b/mail/pom.xml index 1254e0d..5b510bb 100644 --- a/mail/pom.xml +++ b/mail/pom.xml @@ -3,9 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - parent + protools pro.tools - 2.0 + 3.0 4.0.0 @@ -15,7 +15,7 @@ pro.tools common - 2.0 + 3.0 diff --git a/pom.xml b/pom.xml index 0bf9c58..b7ea04c 100644 --- a/pom.xml +++ b/pom.xml @@ -6,14 +6,14 @@ 4.0.0 pro.tools - parent - 2.0 + protools + 3.0 common mail http security - protools + all @@ -27,17 +27,11 @@ pom - - http://www.tuhaolicai.cc/ - tuhao-team - - sd syl8023who@gmail.com SeanDragon - tuhao-team https://seandragon.github.io +8 diff --git a/security/pom.xml b/security/pom.xml index 1994b3c..1560454 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -3,9 +3,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - parent + protools pro.tools - 2.0 + 3.0 4.0.0 @@ -15,7 +15,7 @@ pro.tools common - 2.0 + 3.0 From 35963a6f00e19c73318b6a1dcaa5cfa1a5d7e84e Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:24:22 +0800 Subject: [PATCH 09/69] =?UTF-8?q?1=20clean=20install=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c18d1c..facb9a0 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ - [http](#common) - [mail](#common) - [security](#common) - - [protools](#all) + - [all](#all) ## common * 数据的处理 From 04062fc7e21b48a3ae7ed10314d036c92068dff8 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:31:46 +0800 Subject: [PATCH 10/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index facb9a0..f5fd9fd 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ * 数据的处理 * 文件的处理 * script 引擎的封装 -* 系统方面查询的封装和日期对象的封装 +* 系统方面查询的封装 +* 日期对象的封装DatePlus +* 数值对象的封装Decimal ## http * 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) ## mail From 301dd0da51511608cffc086ed159307caeac69ec Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:32:38 +0800 Subject: [PATCH 11/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f5fd9fd..8b74b4a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ * 日期对象的封装DatePlus * 数值对象的封装Decimal ## http +* 统一发送对象为HttpSend +* 统一接收对象为HttpReceive * 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) ## mail * 封装 JavaMail,并采用了队列等方法提高性能,并简化了发送过程 From ab99162fff24a3faf713f54e73372c412ada2171 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:35:40 +0800 Subject: [PATCH 12/69] =?UTF-8?q?1=20=E8=87=AA=E5=8A=A8=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9031f2a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: java + +java: + - 1.8 + +sudo: false + +install: + - mvn clean install \ No newline at end of file From 07d65d66d264f0ad9d790ad087823e73d8e3c7ef Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:41:02 +0800 Subject: [PATCH 13/69] =?UTF-8?q?1=20gson=E4=BE=9D=E8=B5=96=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/pom.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/pom.xml b/common/pom.xml index a9897e5..5b69fdf 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -23,18 +23,12 @@ com.google.guava guava - 23.5-jre - - - - - - org.google.code.gson + com.google.code.gson gson 2.8.3 From 5cfc0792020ea84ba7f544b636ae6cd81b820f07 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:41:25 +0800 Subject: [PATCH 14/69] =?UTF-8?q?1=20gson=E4=BE=9D=E8=B5=96=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pom.xml b/common/pom.xml index 5b69fdf..4baad83 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -30,7 +30,7 @@ com.google.code.gson gson - 2.8.3 + 2.8.0 From 89e6f929b3fbd4830d612f72fb6436ecad8fe914 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:43:45 +0800 Subject: [PATCH 15/69] =?UTF-8?q?1=20gson=E4=BE=9D=E8=B5=96=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/pom.xml | 4 ++-- pom.xml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/common/pom.xml b/common/pom.xml index 4baad83..a7ada1a 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -28,9 +28,9 @@ - com.google.code.gson + org.google.code.gson gson - 2.8.0 + 2.8.3 diff --git a/pom.xml b/pom.xml index b7ea04c..c2de16d 100644 --- a/pom.xml +++ b/pom.xml @@ -94,4 +94,12 @@ + + + our + Nexus Repository + http://maven.asyou.cc:8081/repository/maven-public/ + + + \ No newline at end of file From 48541108100a40c95d880a8a545753e325b16530 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 13:47:37 +0800 Subject: [PATCH 16/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 8b74b4a..6894357 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # protools + +[![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) + 历经开发周期两年,并且应用过千万级别项目的工具箱 +### 目录 + - [protools](#protools) - [common](#common) - [http](#common) From 88507b10463165f2e642c27a92b5348d4ad2a202 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 15:30:14 +0800 Subject: [PATCH 17/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6894357..6a9e415 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ - [protools](#protools) - [common](#common) - - [http](#common) - - [mail](#common) + - [http](#http) + - [mail](#mail) - [security](#common) - [all](#all) From e8a484e43a193a289289b16842c28f545569a73e Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 17:16:19 +0800 Subject: [PATCH 18/69] =?UTF-8?q?1=20=E4=BF=AE=E6=94=B9README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a9e415..7094900 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ ## security * 封装了 jdk 和 bouncycastle 中几十种常见加密方式 ## all -* all 版本 \ No newline at end of file +* 如果需要使用上述多个模块,可以导入all模块以使用所有模块 \ No newline at end of file From aac512ac7894d26771afa81986b7fe01aa3df1f8 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 17:58:16 +0800 Subject: [PATCH 19/69] =?UTF-8?q?1=20=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/test/java/decimal/TestDecimal.java | 89 ---------- common/src/test/java/file/TestBasic.java | 157 ----------------- common/src/test/java/queue/MyQueue.java | 82 --------- .../src/test/java/queue/test/TestMyQueue.java | 92 ---------- .../src/test/java/time/TestLocalDateTime.java | 82 --------- http/src/main/test/http/TestNetty.java | 64 ------- http/src/main/test/http/TestURL.java | 165 ------------------ security/src/main/test/TestMd5.java | 40 ----- 8 files changed, 771 deletions(-) delete mode 100644 common/src/test/java/decimal/TestDecimal.java delete mode 100644 common/src/test/java/file/TestBasic.java delete mode 100644 common/src/test/java/queue/MyQueue.java delete mode 100644 common/src/test/java/queue/test/TestMyQueue.java delete mode 100644 common/src/test/java/time/TestLocalDateTime.java delete mode 100644 http/src/main/test/http/TestNetty.java delete mode 100644 http/src/main/test/http/TestURL.java delete mode 100644 security/src/main/test/TestMd5.java diff --git a/common/src/test/java/decimal/TestDecimal.java b/common/src/test/java/decimal/TestDecimal.java deleted file mode 100644 index 7331568..0000000 --- a/common/src/test/java/decimal/TestDecimal.java +++ /dev/null @@ -1,89 +0,0 @@ -package decimal; - -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; -import pro.tools.data.decimal.Decimal; -import pro.tools.data.text.ToolJson; -import pro.tools.data.text.ToolRandoms; - -import java.math.MathContext; -import java.math.RoundingMode; -import java.time.LocalDateTime; - -@RunWith(JUnit4.class) -public class TestDecimal { - @Test(timeout = 1000) - public void test1() { - Decimal instance = Decimal.instance(1).div(3); - String s = instance.fullStrValue(); - instance.fullStrValue(2, RoundingMode.HALF_EVEN); - System.out.println(s); - } - - @Test - public void test2() { - LocalDateTime localDateTime = LocalDateTime.now(); - String localDateTimeStr = ToolJson.anyToJson(localDateTime); - System.out.println(localDateTimeStr); - LocalDateTime localDateTime1 = ToolJson.jsonToModel(localDateTimeStr, LocalDateTime.class); - System.out.println(localDateTime1); - } - - @Test - public void test3() { - String s = "{value: \"2017-11-24 18:55:24:373\"}"; - System.out.println(ToolJson.jsonToModel(s, LocalDateTime.class)); - } - - @Test(timeout = 2 * 60 * 1000) - public void test4() { - - String s = ""; - - for (int i = 0; i < 100000; i++) { - s = s.concat(ToolRandoms.getAuthCodeNumber(1)); - } - s = s.concat("."); - for (int i = 0; i < 100000; i++) { - s = s.concat(ToolRandoms.getAuthCodeNumber(1)); - } - - Decimal decimal1 = Decimal.instance(s, MathContext.UNLIMITED); - decimal1.sqrt2(100000); - - System.out.println(decimal1.fullStrValue()); - } - - @Test - public void test5() { - String authCodeAll = ToolRandoms.getAuthCodeAll(2); - System.out.println(authCodeAll); - - System.out.println(ToolRandoms.getAuthCodeAllChar()); - } - - @Test - public void test6() { - Decimal instance = Decimal.instance(3, MathContext.UNLIMITED); - Decimal sqrt2 = instance.sqrt2(10000); - System.out.println(sqrt2); - System.out.println(sqrt2.mul(sqrt2)); - } - - @Test - public void test7() { - Double loanAmountD = 4000D; - Double currentAmountD = 2000D; - - Decimal canBuyAmountD = Decimal.instance(loanAmountD).sub(currentAmountD); - - Decimal buyAfterAmountD = canBuyAmountD.clone().sub(2000); - - System.out.println(canBuyAmountD); - System.out.println(buyAfterAmountD); - - System.out.println(buyAfterAmountD.doubleValue() < 0.00D); - System.out.println(buyAfterAmountD.doubleValue() == 0.00D); - } -} diff --git a/common/src/test/java/file/TestBasic.java b/common/src/test/java/file/TestBasic.java deleted file mode 100644 index b29ae4b..0000000 --- a/common/src/test/java/file/TestBasic.java +++ /dev/null @@ -1,157 +0,0 @@ -package file; - -import com.google.common.collect.Lists; -import org.junit.Test; -import pro.tools.data.text.ToolJson; -import pro.tools.data.text.ToolRandoms; -import pro.tools.data.text.json.TypeBuilder; -import pro.tools.path.ToolPath; - -import java.io.IOException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * @author SeanDragon - *

- * Create By 2017-09-01 11:56 - */ -public class TestBasic { - - public static final Path fileName = Paths.get("d:/2.txt"); - public static final Path dirName = Paths.get("d:/2"); - - @Test - public void testFileIs() { - boolean file = ToolPath.isFile(fileName); - System.out.println(file); - boolean dir = ToolPath.isDir(fileName); - System.out.println(dir); - boolean exists = ToolPath.isExists(fileName); - System.out.println(exists); - boolean canWrite = ToolPath.canWrite(fileName); - System.out.println(canWrite); - boolean canRead = ToolPath.canRead(fileName); - System.out.println(canRead); - } - - @Test - public void testDirIs() { - boolean file = ToolPath.isFile(dirName); - System.out.println(file); - boolean dir = ToolPath.isDir(dirName); - System.out.println(dir); - boolean exists = ToolPath.isExists(dirName); - System.out.println(exists); - boolean canWrite = ToolPath.canWrite(dirName); - System.out.println(canWrite); - boolean canRead = ToolPath.canRead(dirName); - System.out.println(canRead); - } - - @Test - public void testCreateDir() throws IOException { - Path dir = ToolPath.createDir(Paths.get("d:/2"), true); - System.out.println(dir); - } - - @Test - public void testCreateFile() throws IOException { - Path file = ToolPath.createFile(Paths.get("d:/2"), true); - System.out.println(file); - } - - @Test - public void testMove() throws IOException { - Path move = ToolPath.move(Paths.get("d:/2"), Paths.get("c:/"), true); - System.out.println(move); - } - - @Test - public void testRmrDir() throws IOException { - ToolPath.rmr(Paths.get("d:/2")); - } - - @Test - public void testReNameFile() throws IOException { - Path path = ToolPath.reName(fileName, "2.txt"); - System.out.println(path); - } - - @Test - public void testReNameDir() throws IOException { - Path path = ToolPath.reName(dirName, "2"); - System.out.println(path); - } - - @Test - public void testGson() { - int count = 1000; - long begin = 0l; - List ddds = Lists.newArrayListWithCapacity(count); - for (; count > 0; count--) { - ddds.add(new DDD().setI(count).setS(ToolRandoms.getRandomStr())); - } - - System.out.println(ddds); - - String s = ToolJson.anyToJson(ddds); - - begin = System.currentTimeMillis(); - ArrayList arrayList = ToolJson.jsonToArrayList(s); - System.out.println(System.currentTimeMillis() - begin); - - begin = System.currentTimeMillis(); - List maps = ToolJson.jsonToMapList(s); - System.out.println(System.currentTimeMillis() - begin); - - begin = System.currentTimeMillis(); - List modelList = ToolJson.jsonToModelList(s, DDD.class); - System.out.println(System.currentTimeMillis() - begin); - - begin = System.currentTimeMillis(); - List any = ToolJson.jsonToAny(s - , TypeBuilder.newInstance(List.class) - .addTypeParam(DDD.class) - .build()); - System.out.println(System.currentTimeMillis() - begin); - - begin = System.currentTimeMillis(); - List mapList = ToolJson.anyToAny(s, TypeBuilder.newInstance(List.class).addTypeParam(Map.class).build()); - System.out.println(System.currentTimeMillis() - begin); - - begin = System.currentTimeMillis(); - ; - String newS = ToolJson.anyToAny(s, String.class); - System.out.println(System.currentTimeMillis() - begin); - - System.out.println(newS); - } - -} - -class DDD { - private Integer i; - private String s; - - public Integer getI() { - return i; - } - - public DDD setI(Integer i) { - this.i = i; - return this; - } - - public String getS() { - return s; - } - - public DDD setS(String s) { - this.s = s; - return this; - } -} \ No newline at end of file diff --git a/common/src/test/java/queue/MyQueue.java b/common/src/test/java/queue/MyQueue.java deleted file mode 100644 index 66d4d0b..0000000 --- a/common/src/test/java/queue/MyQueue.java +++ /dev/null @@ -1,82 +0,0 @@ -package queue; - -/** - * Created on 17/9/2 13:28 星期六. - * - * @author sd - */ -public class MyQueue { - - private int[] pQueue; - private int iQueueLen;//队列里面有多少元素 - private int iQueueCapacity;//初始化大小 - private int iHead; - private int iTail; - - public MyQueue(int capacity) { - this.iQueueCapacity = capacity; - this.pQueue = new int[capacity]; - clear(); - } - - /** - * 清空 - */ - public void clear() { - this.iHead = 0; - this.iTail = 0; - this.iQueueLen = 0; - } - - /** - * 判空 - * - * @return - */ - public boolean empty() { - return iQueueLen == 0; - } - - public boolean full() { - return iQueueLen == iQueueCapacity; - } - - /** - * 获取队列长度 - */ - public int length() { - return iQueueLen; - } - - - public boolean in(int element) { - if (full()) { - return false; - } - - this.pQueue[iTail] = element; - iTail = (++iTail) % iQueueCapacity; - iQueueLen++; - return true; - } - - public int out() { - if (empty()) { - throw new NullPointerException(""); - } - - int element = pQueue[iHead]; - iHead = (++iHead) % iQueueCapacity; - iQueueLen--; - return element; - } - - public void traverse() { - System.out.println(); - for (int i = iHead; i < pQueue.length + iHead; i++) { - System.out.println(pQueue[i % iQueueCapacity]); - } - System.out.println(); - } - -} diff --git a/common/src/test/java/queue/test/TestMyQueue.java b/common/src/test/java/queue/test/TestMyQueue.java deleted file mode 100644 index 2a020ce..0000000 --- a/common/src/test/java/queue/test/TestMyQueue.java +++ /dev/null @@ -1,92 +0,0 @@ -package queue.test; - -import org.junit.Test; -import pro.tools.system.ToolClassSearch; -import queue.MyQueue; - -import java.util.Set; -import java.util.concurrent.atomic.LongAdder; - -/** - * Created on 17/9/2 13:48 星期六. - * - * @author sd - */ -public class TestMyQueue { - - @Test - public void test2() { - LongAdder longAdder = new LongAdder(); - longAdder.increment(); - System.out.println(longAdder.longValue()); - longAdder.increment(); - System.out.println(longAdder.longValue()); - System.out.println(longAdder.sum()); - System.out.println(longAdder.toString()); - System.out.println(longAdder.longValue()); - - } - - @Test - public void test4() { - Set allClazz = ToolClassSearch.getAllClazz(); - System.out.println(allClazz); - } - - @Test - public void test3() { - - int A = Integer.MAX_VALUE; - int B = Integer.MAX_VALUE - 129; - - System.out.println(A); - System.out.println(B); - - A = A ^ B; - - B = A ^ B; - - A = A ^ B; - - System.out.println(A); - System.out.println(B); - - - A = A ^ B; - - B = A ^ B; - - A = A ^ B; - - - System.out.println(A); - System.out.println(B); - } - - @Test - public void test1() { - - MyQueue myQueue = new MyQueue(5); - myQueue.in(1); - myQueue.in(2); - myQueue.in(3); - myQueue.in(4); - myQueue.in(5); - - myQueue.traverse(); - - System.out.println(); - - System.out.println(myQueue.out()); - System.out.println(myQueue.out()); - System.out.println(myQueue.out()); - - System.out.println(); - - myQueue.traverse(); - - myQueue.clear(); - myQueue.in(6); - myQueue.traverse(); - } -} diff --git a/common/src/test/java/time/TestLocalDateTime.java b/common/src/test/java/time/TestLocalDateTime.java deleted file mode 100644 index 2887f4e..0000000 --- a/common/src/test/java/time/TestLocalDateTime.java +++ /dev/null @@ -1,82 +0,0 @@ -package time; - -import org.junit.Test; -import pro.tools.data.decimal.Decimal; -import pro.tools.data.text.ToolJson; -import pro.tools.time.DatePlus; -import pro.tools.time.DateType; - -import java.math.MathContext; -import java.time.LocalDate; -import java.time.LocalDateTime; - -/** - * @author SeanDragon - *

- * Create By 2017-10-26 19:38 - */ -public class TestLocalDateTime { - @Test - public void test1() { - LocalDateTime localDateTime = LocalDateTime.now(); - String x = ToolJson.anyToJson(localDateTime); - System.out.println(x); - LocalDateTime localDateTime1 = ToolJson.jsonToAny(x, LocalDateTime.class); - System.out.println(localDateTime1); - } - - @Test - public void test2() { - LocalDateTime localDateTime = LocalDateTime.now(); - System.out.println(ToolJson.anyToJson(localDateTime)); - String s = "2017-10-26 09:22:19:647"; - s = "{\"$timestamp\": \"2017-10-26 20:22:03:720\"}"; - LocalDateTime o = ToolJson.jsonToAny(s, LocalDateTime.class); - System.out.println(o); - } - - @Test - public void test3() { - LocalDate localDate = LocalDate.now(); - String x = ToolJson.anyToJson(localDate); - System.err.println(x); - LocalDate localDate1 = ToolJson.jsonToAny(x, LocalDate.class); - System.out.println(localDate1); - } - - @Test - public void test4() { - DatePlus datePlus = new DatePlus(); - System.out.println(datePlus); - String s = ToolJson.anyToJson(datePlus); - System.out.println(s); - DatePlus t = ToolJson.jsonToAny(s, DatePlus.class); - System.out.println(t); - } - - @Test - public void test5() { - DatePlus datePlus1 = new DatePlus(); - DatePlus datePlus2 = new DatePlus(); - - System.out.println(datePlus1); - System.out.println(datePlus2); - System.out.println(); - - boolean before = datePlus1.isBefore(datePlus2, DateType.SECONDS); - System.out.println(before); - boolean same = datePlus1.isSame(datePlus2, DateType.SECONDS); - System.out.println(same); - boolean after = datePlus1.isAfter(datePlus2, DateType.SECONDS); - System.out.println(after); - } - - @Test - public void test6() { - Decimal decimal = new Decimal(66.66, MathContext.UNLIMITED); - String x = ToolJson.anyToJson(decimal); - System.out.println(x); - Object o = ToolJson.jsonToAny(x, Decimal.class); - System.out.println(o); - } -} diff --git a/http/src/main/test/http/TestNetty.java b/http/src/main/test/http/TestNetty.java deleted file mode 100644 index aed1e92..0000000 --- a/http/src/main/test/http/TestNetty.java +++ /dev/null @@ -1,64 +0,0 @@ -package http; - -import org.junit.Test; -import pro.tools.http.netty.clientpool.DefaultClientPool; -import pro.tools.http.pojo.HttpException; -import pro.tools.http.pojo.HttpMethod; -import pro.tools.http.pojo.HttpReceive; -import pro.tools.http.pojo.HttpSend; - -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * @author SeanDragon - *

- * Create By 2017-11-28 16:46 - */ -public class TestNetty { - static DefaultClientPool defaultClientPool; - - @Test - public void test1() throws HttpException { - defaultClientPool = new DefaultClientPool("http://localhost:92"); - - int count = 1000; - AtomicInteger finishCount = new AtomicInteger(); - AtomicInteger errCount = new AtomicInteger(); - AtomicInteger okCount = new AtomicInteger(); - - long begin = System.currentTimeMillis(); - for (int i = 0; i < count; i++) { - Thread newThread = new Thread(() -> { - HttpReceive receive = defaultClientPool.request(HttpSend.of("/getService").setMethod(HttpMethod.POST),10, TimeUnit.SECONDS); - // HttpReceive receive = ToolSendHttp.post("http://localhost:92/getService"); - Boolean haveError = receive.getHaveError(); - if (haveError || receive.getStatusCode() != 200) { - System.out.println(finishCount.incrementAndGet() + "-error"); - System.out.println(receive.getErrMsg()); - errCount.incrementAndGet(); - } else { - System.out.println(finishCount.incrementAndGet() + "-ok"); - okCount.incrementAndGet(); - } - }); - newThread.start(); - } - - while (finishCount.get() < count) ; - System.out.println("ERROR:\t\t" + errCount.get()); - System.out.println("OK:\t\t" + okCount.get()); - System.out.println("TIME:\t\t" + (System.currentTimeMillis() - begin) / 1000D + "秒"); - DefaultClientPool.stopAll(); - while (true); - } - - @Test - public void test2() { - StringBuilder stringBuilder = new StringBuilder("123123"); - stringBuilder.deleteCharAt(stringBuilder.length()-1); - - System.out.println(stringBuilder); - System.out.println(stringBuilder.toString()); - } -} diff --git a/http/src/main/test/http/TestURL.java b/http/src/main/test/http/TestURL.java deleted file mode 100644 index 8ecd361..0000000 --- a/http/src/main/test/http/TestURL.java +++ /dev/null @@ -1,165 +0,0 @@ -package http; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.Unpooled; -import org.junit.BeforeClass; -import org.junit.Test; -import pro.tools.constant.StrConst; -import pro.tools.data.text.ToolJson; -import pro.tools.http.netty.clientpool.DefaultClientPool; -import pro.tools.http.okhttp.ToolSendHttp; -import pro.tools.http.pojo.HttpException; -import pro.tools.http.pojo.HttpMethod; -import pro.tools.http.pojo.HttpReceive; -import pro.tools.http.pojo.HttpSend; - -import java.net.URLDecoder; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Created on 17/9/3 13:12 星期日. - * - * @author sd - */ -public class TestURL { - - @BeforeClass - public static void bc() { - map = ToolJson.jsonToMap("{\n" + - " \"Action\": \"2\",\n" + - " \"DelayTransfer\": \"\",\n" + - " \"LoanJsonList\": \"[{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200000\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200001\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200002\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200003\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200004\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200005\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200006\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200007\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200008\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"900.25\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200009\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000010\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000011\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000012\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000013\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000014\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000015\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000016\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000017\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000018\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000019\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"7001.94\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"p2015\\\",\\\"OrderNo\\\":\\\"20171120171302992842000020\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"1000.0\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"}]\",\n" + - " \"LoanJsonList1\": \"[{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200000\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200001\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200002\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200003\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200004\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200005\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200006\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200007\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200008\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"900.25\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200009\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000010\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000011\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000012\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000013\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000014\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000015\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000016\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000017\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000018\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000019\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"7001.94\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"p2015\\\",\\\"OrderNo\\\":\\\"20171120171302992842000020\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"1000.0\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"}]\",\n" + - " \"LoanJsonList2\": \"[{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200000\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200001\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200002\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200003\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200004\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200005\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200006\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200007\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200008\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"900.25\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200009\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000010\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000011\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000012\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000013\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000014\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000015\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000016\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000017\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000018\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000019\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"7001.94\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"p2015\\\",\\\"OrderNo\\\":\\\"20171120171302992842000020\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"1000.0\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"}]\",\n" + - " \"LoanJsonList3\": \"[{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200000\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200001\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200002\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200003\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200004\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200005\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200006\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200007\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200008\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"900.25\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200009\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000010\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000011\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000012\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000013\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000014\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000015\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000016\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000017\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000018\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000019\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"7001.94\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"p2015\\\",\\\"OrderNo\\\":\\\"20171120171302992842000020\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"1000.0\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"}]\",\n" + - " \"LoanJsonList4\": \"[{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200000\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200001\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200002\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200003\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200004\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200005\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200006\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200007\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200008\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"900.25\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"2017112017130299284200009\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000010\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000011\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000012\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000013\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000014\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000015\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000016\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000017\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"100.03\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000018\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"200.06\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"m121901\\\",\\\"OrderNo\\\":\\\"20171120171302992842000019\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"7001.94\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"},{\\\"LoanOutMoneymoremore\\\":\\\"m121906\\\",\\\"LoanInMoneymoremore\\\":\\\"p2015\\\",\\\"OrderNo\\\":\\\"20171120171302992842000020\\\",\\\"BatchNo\\\":\\\"171120_2\\\",\\\"ExchangeBatchNo\\\":\\\"\\\",\\\"AdvanceBatchNo\\\":\\\"\\\",\\\"Amount\\\":\\\"1000.0\\\",\\\"FullAmount\\\":\\\"10000.0\\\",\\\"TransferName\\\":\\\"2\\\",\\\"Remark\\\":\\\"\\\",\\\"SecondaryJsonList\\\":\\\"\\\"}]\",\n" + - " \"NeedAudit\": \"1\",\n" + - " \"NotifyURL\": \"http://47.94.168.101:83/admin/payPlatform/notify/repayNotify\",\n" + - " \"Remark1\": \"2\",\n" + - " \"Remark2\": \"84\",\n" + - " \"Remark3\": \"\",\n" + - " \"TransferAction\": \"2\",\n" + - " \"TransferType\": \"2\",\n" + - " \"orderNo\": \"20171120171302992842\"\n" + - "}"); - } - - @Test - public void test1() { - String url = "https://baidu.com"; - url = "http://192.168.15.100:92/getService"; - HttpSend httpSend = new HttpSend(url); - HttpReceive send = ToolSendHttp.send(httpSend); - System.out.println(send); - } - - @Test - public void test2() { - ByteBuf buffer = Unpooled.wrappedBuffer("123".getBytes()); - System.out.println(buffer.toString(StrConst.DEFAULT_CHARSET)); - } - - private volatile static Map map; - - @Test - public void test3() throws HttpException { - DefaultClientPool clientPool = new DefaultClientPool("http://192.168.15.22:8888"); - HttpSend httpSend = new HttpSend("/payPlatform/transferServlet"); - httpSend.setParams(map) - .setMethod(HttpMethod.POST); - - HttpReceive post = clientPool.request(httpSend); - - System.out.println(post.getHaveError()); - System.out.println(post.getResponseBody()); - System.out.println(post.getErrMsg()); - System.out.println(post.getStatusCode()); - - post = ToolSendHttp.post("http://192.168.15.22:8888/payPlatform/transferServlet", map); - - System.out.println(post.getHaveError()); - System.out.println(post.getResponseBody()); - System.out.println(post.getErrMsg()); - System.out.println(post.getStatusCode()); - } - - @Test - public void test4() throws Exception { - DefaultClientPool clientPool = new DefaultClientPool("http://localhost:9092"); - HttpSend httpSend = new HttpSend("/test"); - httpSend.setMethod(HttpMethod.POST); - httpSend.setParams(map); - - HttpReceive post = clientPool.request(httpSend); - //HttpReceive post = ToolSendHttp.post("http://localhost:9092/test", map); - - System.out.println(post.getHaveError()); - System.out.println(post.getResponseBody()); - System.out.println(post.getErrMsg()); - System.out.println(post.getStatusCode()); - } - - @Test - public void test5() { - String s = "dHKj71wpcLi8XeLO33T4Y5DoEYE3TjMPcn0tc21hNyJY4J5iOxnu2Fj3iq7xgjrkke3fYq7a6n3R\n" + - "6w8AEQfNxICdpKGCHp6WH67eHWdvR9ae/4j3flA36yq7qEYfszXX27I+sQmVj7fnYwg8R8CQlMwJ\n" + - "Iak4KAN03ggdJoYXpTI=\n"; - - ByteBuf byteBuf = Unpooled.copiedBuffer(s.getBytes()); - System.out.println(byteBuf.toString(StrConst.DEFAULT_CHARSET)); - - StringBuffer stringBuffer = new StringBuffer("123"); - String substring = stringBuffer.substring(0, stringBuffer.length() - 1); - System.out.println(substring); - } - - @Test - public void test6() throws Exception { - - String info = "R8Jgu2qcmomnUjeFDNnx6QQBTy6yIsQu1wFl9L7eCc4fWx3YxFSpDxZHgHg4i9FcblhWc3/L7EbZ\n" + - "w5Nwxm9SKSc2QFSSiOY0riEL57WLjzXdgQUQrzAIrypXN4GJGgSiGQ4oDf2lv3qInWqMIdGoFHSh\n" + - "KfmW8j80yIYzlW68fCQ=\n"; - - String request = "dHKj71wpcLi8XeLO33T4Y5DoEYE3TjMPcn0tc21hNyJY4J5iOxnu2Fj3iq7xgjrkke3fYq7a6n3R\n" + - "6w8AEQfNxICdpKGCHp6WH67eHWdvR9ae/4j3flA36yq7qEYfszXX27I+sQmVj7fnYwg8R8CQlMwJ\n" + - "Iak4KAN03ggdJoYXpTI=\n"; - - System.out.println(request); - String decode = URLDecoder.decode(request, StrConst.DEFAULT_CHARSET_NAME); - System.out.println(decode); -// -// String received = "dHKj71wpcLi8XeLO33T4Y5DoEYE3TjMPcn0tc21hNyJY4J5iOxnu2Fj3iq7xgjrkke3fYq7a6n3R\n" + -// "6w8AEQfNxICdpKGCHp6WH67eHWdvR9ae/4j3flA36yq7qEYfszXX27I sQmVj7fnYwg8R8CQlMwJ\n" + -// "Iak4KAN03ggdJoYXpTI=\n"; - - DefaultClientPool defaultClientPool = new DefaultClientPool("http://192.168.15.22:8888"); - - Map map = new LinkedHashMap<>(); -// String info = "C9C6ALCYDmivbo+eXz8ZRnLMPtXzpFiZTZKGD+K0EoA6gocrCbuofntyzPYlLwMbEUGHeZwRXvpS\n" + -// "xUuejkIwfCwpkUqAxZnbWwZJaWqZxJifz3kCnr2pR6gGppndU2B8xyOD7+CQAYGIfLK1zcVnWNEZ\n" + -// "r+gZvCFp3qee38a45BE="; - -// String info = "jWcKBkO4xGnm/MCD7s9txWXgWuxTEI0DYt6HRfQUk14QMUWJTcEgmN0hlqPjdNKBGpO sb8tNgRN\n" + -// "j5Du2K1zullre4VWd/2MezgQcvcsHJKallmhIalj iBRk868wdDy3vL36LsXNGWKmrqb32LrjhZ2\n" + -// "Yv2L1XpfGtm0tt oY8=\n"; - -// String info = "pSTIEx+Z9Y5E6CyHwz57XBJwhfKcQWTA5IWmLzTW/xNOjID9YWwTqk3EqaCj3nUEO1E7EPstBPPj\n" + -// "KOVJIENAEeriGdmHOCBF9miPuiT1gpDN812hzwRhFg3tGM7A7uqxG6KN3XsT95zSAsCoa4g967v6\n" + -// "N9vbPOU6OHdffhxObuA=\n"; - map.put("data", request); -// map.put("data", info); - -// HttpReceive post = ToolSendHttp.post("http://127.0.0.1:8888/payPlatform/balanceDecodeServlet", map); -// System.out.println("post:" + post.getResponseBody()); - - HttpSend httpSend = new HttpSend("/payPlatform/balanceDecodeServlet"); - httpSend.setParams(map).setMethod(HttpMethod.POST); - HttpReceive post1 = defaultClientPool.request(httpSend); - System.out.println("post1:" + post1.getResponseBody()); - -// HttpReceive httpReceive = ToolHttp.sendGet("http://127.0.0.1:8888/payPlatform/balanceDecodeServlet", map); -// System.err.println("infoResult:" + httpReceive.getResponseBody()); - - } -} diff --git a/security/src/main/test/TestMd5.java b/security/src/main/test/TestMd5.java deleted file mode 100644 index 1ac45eb..0000000 --- a/security/src/main/test/TestMd5.java +++ /dev/null @@ -1,40 +0,0 @@ -import com.google.common.hash.HashCode; -import com.google.common.hash.HashFunction; -import com.google.common.hash.Hasher; -import com.google.common.hash.Hashing; -import org.bouncycastle.util.encoders.Hex; -import org.junit.Test; -import pro.tools.constant.StrConst; -import pro.tools.data.text.ToolJson; -import pro.tools.security.md.ToolMD5; - -import java.security.NoSuchAlgorithmException; - -/** - * @author SeanDragon - *

- * Create By 2017-11-30 16:58 - */ -public class TestMd5 { - @Test - public void test1() throws NoSuchAlgorithmException { - byte [] data = "123456".getBytes(); - long begin = System.currentTimeMillis(); - String result = ToolMD5.encodeMD5Hex(data); - System.out.println(System.currentTimeMillis()-begin); - System.out.println(result); - begin = System.currentTimeMillis(); - HashFunction hashFunction = Hashing.md5(); - Hasher hasher = hashFunction.newHasher(); - hasher.putString("123456", StrConst.DEFAULT_CHARSET); - HashCode hash = hasher.hash(); - System.out.println(System.currentTimeMillis()-begin); - System.out.println(hash.toString()); - System.out.println(Hex.toHexString(hash.asBytes())); - } - - @Test - public void test2() { - System.out.println(ToolJson.anyToJson(null)); - } -} From 78efbd70927381b8b78f354b583d8d01c6908c9c Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 18:00:41 +0800 Subject: [PATCH 20/69] =?UTF-8?q?1=20=E6=B7=BB=E5=A2=9E=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/test/java/package-info.java | 1 + http/src/test/java/package-info.java | 1 + mail/src/test/java/package-info.java | 1 + security/src/test/java/package-info.java | 1 + 4 files changed, 4 insertions(+) create mode 100644 common/src/test/java/package-info.java create mode 100644 http/src/test/java/package-info.java create mode 100644 mail/src/test/java/package-info.java create mode 100644 security/src/test/java/package-info.java diff --git a/common/src/test/java/package-info.java b/common/src/test/java/package-info.java new file mode 100644 index 0000000..af10c3e --- /dev/null +++ b/common/src/test/java/package-info.java @@ -0,0 +1 @@ +// 该目录不为空时,删除此文件 \ No newline at end of file diff --git a/http/src/test/java/package-info.java b/http/src/test/java/package-info.java new file mode 100644 index 0000000..af10c3e --- /dev/null +++ b/http/src/test/java/package-info.java @@ -0,0 +1 @@ +// 该目录不为空时,删除此文件 \ No newline at end of file diff --git a/mail/src/test/java/package-info.java b/mail/src/test/java/package-info.java new file mode 100644 index 0000000..af10c3e --- /dev/null +++ b/mail/src/test/java/package-info.java @@ -0,0 +1 @@ +// 该目录不为空时,删除此文件 \ No newline at end of file diff --git a/security/src/test/java/package-info.java b/security/src/test/java/package-info.java new file mode 100644 index 0000000..af10c3e --- /dev/null +++ b/security/src/test/java/package-info.java @@ -0,0 +1 @@ +// 该目录不为空时,删除此文件 \ No newline at end of file From e6f5764c5d873e5df2ff8600248e0dfe62c78e69 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 18:21:18 +0800 Subject: [PATCH 21/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 7094900..ebe07e2 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ 历经开发周期两年,并且应用过千万级别项目的工具箱 +暂时还未添加到maven中心仓库,这几天部门解散,本人正在找工作,中心仓库的事情后续会跟进 +大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 + ### 目录 - [protools](#protools) From bb6bac282c2b3551ac95510a216110037faaf659 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 18:22:18 +0800 Subject: [PATCH 22/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ebe07e2..66d5c2c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ 历经开发周期两年,并且应用过千万级别项目的工具箱 暂时还未添加到maven中心仓库,这几天部门解散,本人正在找工作,中心仓库的事情后续会跟进 + 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 ### 目录 From 3f5332a6f676e6ad324a37038c97be1c23c4469e Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 18:40:17 +0800 Subject: [PATCH 23/69] =?UTF-8?q?1=20=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 257fa5c..0307c16 100644 --- a/LICENSE +++ b/LICENSE @@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2017 siter + Copyright 2017 SeanDragon Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 281afe7ea4987b329fb34943d253c11290eb67b9 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 18:54:23 +0800 Subject: [PATCH 24/69] =?UTF-8?q?1=20=E4=BB=A3=E7=A0=81=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/pro/tools/data/decimal/Decimal.java | 36 ++++-- .../pro/tools/data/decimal/ToolDecimal.java | 20 +++- .../pro/tools/data/image/ToolBarCode.java | 85 +++++++++----- .../pro/tools/data/image/ToolImageTailor.java | 29 +++-- .../java/pro/tools/data/text/ToolJson.java | 38 ++++++- .../java/pro/tools/data/text/ToolPinYin.java | 3 + .../json/typeadapter/TreeMapTypeAdapter.java | 2 +- .../java/pro/tools/file/ToolFileType.java | 19 +++- .../main/java/pro/tools/path/ToolPath.java | 4 +- .../java/pro/tools/script/ToolScript.java | 10 +- .../main/java/pro/tools/system/ToolOS.java | 1 + .../main/java/pro/tools/time/ToolLunar.java | 22 +++- .../handler/HttpClientChannelPoolHandler.java | 2 +- .../java/pro/tools/security/SecurityUrl.java | 2 +- .../main/java/pro/tools/security/ToolAES.java | 36 ++++-- .../java/pro/tools/security/ToolBase64.java | 25 +++-- .../pro/tools/security/ToolCertificate.java | 106 +++++++++++++----- .../pro/tools/security/ToolCertificate2.java | 95 +++++++++++----- .../main/java/pro/tools/security/ToolDES.java | 36 ++++-- .../java/pro/tools/security/ToolDESede.java | 34 ++++-- .../main/java/pro/tools/security/ToolDH.java | 40 +++++-- .../main/java/pro/tools/security/ToolDSA.java | 30 +++-- .../java/pro/tools/security/ToolECDSA.java | 30 +++-- .../java/pro/tools/security/ToolElGamal.java | 24 +++- .../java/pro/tools/security/ToolHTTPS.java | 32 ++++-- .../java/pro/tools/security/ToolHTTPS2.java | 32 ++++-- .../java/pro/tools/security/ToolIDEA.java | 22 +++- .../main/java/pro/tools/security/ToolPBE.java | 28 +++-- .../java/pro/tools/security/ToolPBE2.java | 32 ++++-- .../main/java/pro/tools/security/ToolRSA.java | 44 ++++++-- .../pro/tools/security/md/ToolHmacRipeMD.java | 34 ++++-- .../java/pro/tools/security/md/ToolMAC.java | 47 ++++++-- .../pro/tools/security/md/ToolMAC_BCP.java | 51 +++++++-- .../java/pro/tools/security/md/ToolMD.java | 30 ++++- .../java/pro/tools/security/md/ToolMD2.java | 10 +- .../java/pro/tools/security/md/ToolMD4.java | 10 +- .../java/pro/tools/security/md/ToolMD5.java | 10 +- .../pro/tools/security/md/ToolRipeMD.java | 40 +++++-- .../java/pro/tools/security/md/ToolSHA1.java | 10 +- .../java/pro/tools/security/md/ToolSHA2.java | 40 +++++-- 40 files changed, 891 insertions(+), 310 deletions(-) diff --git a/common/src/main/java/pro/tools/data/decimal/Decimal.java b/common/src/main/java/pro/tools/data/decimal/Decimal.java index 7e5c1ca..df77c2f 100644 --- a/common/src/main/java/pro/tools/data/decimal/Decimal.java +++ b/common/src/main/java/pro/tools/data/decimal/Decimal.java @@ -50,6 +50,7 @@ public static void setDefaultMathContext(MathContext defaultMathContext) { * 便利生成方式,获取实例方法 * * @param initValue + * * @return */ public static Decimal instance(Object initValue) { @@ -111,7 +112,9 @@ public MathContext getMathContext() { /** * 获取该数被除后的整数 * - * @param object 因数 + * @param object + * 因数 + * * @return 结果 */ public Decimal getDivGetInteger(Object object) { @@ -121,7 +124,9 @@ public Decimal getDivGetInteger(Object object) { /** * 求余 * - * @param object 因数 + * @param object + * 因数 + * * @return 结果 */ public Decimal getRemainder(Object object) { @@ -135,6 +140,7 @@ public Decimal getRemainder(Object object) { * 基本数值运算:加法 * * @param object + * * @return */ public Decimal add(Object object) { @@ -146,6 +152,7 @@ public Decimal add(Object object) { * 减法 * * @param object + * * @return */ public Decimal sub(Object object) { @@ -157,6 +164,7 @@ public Decimal sub(Object object) { * 乘法 * * @param object + * * @return */ public Decimal mul(Object object) { @@ -168,6 +176,7 @@ public Decimal mul(Object object) { * 除法 * * @param object + * * @return */ public Decimal div(Object object) { @@ -191,7 +200,9 @@ public Decimal abs() { /** * 幂运算 * - * @param n 幂数 + * @param n + * 幂数 + * * @return 结果 */ public Decimal pow(int n) { @@ -202,7 +213,9 @@ public Decimal pow(int n) { /** * 开平方 * - * @param scale 精度 + * @param scale + * 精度 + * * @return 结果 */ public Decimal sqrt2(int scale) { @@ -221,7 +234,9 @@ public Decimal sqrt2(int scale) { /** * 开N次方 * - * @param n 几次方 + * @param n + * 几次方 + * * @return 结果 */ public Decimal sqrtN(int n) { @@ -293,7 +308,9 @@ public double doubleValue() { /** * 传入进度和舍入原则进行double * - * @param scale 进度 + * @param scale + * 进度 + * * @return 结果 */ public double doubleValue(int scale) { @@ -303,8 +320,11 @@ public double doubleValue(int scale) { /** * 传入进度和舍入原则进行double * - * @param scale 进度 - * @param roundingMode 舍入原则 + * @param scale + * 进度 + * @param roundingMode + * 舍入原则 + * * @return 结果 */ public double doubleValue(int scale, RoundingMode roundingMode) { diff --git a/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java b/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java index 1eba063..18b1a5e 100644 --- a/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java +++ b/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java @@ -25,9 +25,13 @@ private ToolDecimal() { /** * 自己实现的开平方 * - * @param number 数值 - * @param scale 精度 - * @param roundingMode 舍入方法 + * @param number + * 数值 + * @param scale + * 精度 + * @param roundingMode + * 舍入方法 + * * @return 结果 */ static BigDecimal sqrt(BigDecimal number, int scale, RoundingMode roundingMode) { @@ -98,7 +102,9 @@ static BigDecimal sqrt(BigDecimal number, int scale, RoundingMode roundingMode) *

* 此方法返回零位的最高位(“最左侧”)前在指定的int值的二进制补码表示法,或32个1位的数量,如果该值为零。 * - * @param i 数字 + * @param i + * 数字 + * * @return 结果 */ public static int numberOfLeadingZeros(long i) { @@ -134,7 +140,9 @@ public static int numberOfLeadingZeros(long i) { /** * 设置给DecimalFormat用的精度字符创 * - * @param scale 精度 + * @param scale + * 精度 + * * @return 结果 */ public static String scale2FormatStr(int scale) { @@ -174,6 +182,7 @@ public static DecimalFormat scale2Format(final int scale, final RoundingMode rou /** * @param value * @param scale + * * @return */ public static String number2Str(Double value, int scale) { @@ -183,6 +192,7 @@ public static String number2Str(Double value, int scale) { /** * @param value * @param scale + * * @return */ public static Double number2double(Double value, int scale) { diff --git a/common/src/main/java/pro/tools/data/image/ToolBarCode.java b/common/src/main/java/pro/tools/data/image/ToolBarCode.java index 872f6ba..8ffd183 100644 --- a/common/src/main/java/pro/tools/data/image/ToolBarCode.java +++ b/common/src/main/java/pro/tools/data/image/ToolBarCode.java @@ -38,11 +38,16 @@ private ToolBarCode() { /** * 生成二维码 * - * @param content 条码文本内容 - * @param width 条码宽度 - * @param height 条码高度 - * @param fileType 文件类型,如png - * @param savePath 保存路径 + * @param content + * 条码文本内容 + * @param width + * 条码宽度 + * @param height + * 条码高度 + * @param fileType + * 文件类型,如png + * @param savePath + * 保存路径 */ @SuppressWarnings({"rawtypes", "unchecked", "deprecation"}) @Deprecated @@ -58,12 +63,18 @@ public static void encode(String content, int width, int height, String fileType /** * 生成带logo的二维码 * - * @param content 条码文本内容 - * @param width 条码宽度 - * @param height 条码高度 - * @param logoPath 条码中logo的路径 - * @param fileType 文件类型,如png - * @param savePath 保存路径 + * @param content + * 条码文本内容 + * @param width + * 条码宽度 + * @param height + * 条码高度 + * @param logoPath + * 条码中logo的路径 + * @param fileType + * 文件类型,如png + * @param savePath + * 保存路径 */ public static void encodeLogo(String content, int width, int height, String logoPath, String fileType, String savePath) throws IOException { BitMatrix matrix = MatrixToImageWriterEx.createQRCode(content, width, height); @@ -75,6 +86,7 @@ public static void encodeLogo(String content, int width, int height, String logo * 解码 * * @param filePath + * * @return */ @SuppressWarnings({"rawtypes", "unchecked"}) @@ -154,9 +166,13 @@ class MatrixToImageWriterEx { /** * 根据内容生成二维码数据 * - * @param content 二维码文字内容[为了信息安全性,一般都要先进行数据加密] - * @param width 二维码照片宽度 - * @param height 二维码照片高度 + * @param content + * 二维码文字内容[为了信息安全性,一般都要先进行数据加密] + * @param width + * 二维码照片宽度 + * @param height + * 二维码照片高度 + * * @return */ public static BitMatrix createQRCode(String content, int width, int height) { @@ -177,10 +193,15 @@ public static BitMatrix createQRCode(String content, int width, int height) { /** * 写入二维码、以及将照片logo写入二维码中 * - * @param matrix 要写入的二维码 - * @param format 二维码照片格式 - * @param imagePath 二维码照片保存路径 - * @param logoPath logo路径 + * @param matrix + * 要写入的二维码 + * @param format + * 二维码照片格式 + * @param imagePath + * 二维码照片保存路径 + * @param logoPath + * logo路径 + * * @throws IOException */ @SuppressWarnings({"deprecation"}) @@ -196,11 +217,17 @@ public static void writeToFile(BitMatrix matrix, String format, String imagePath /** * 写入二维码、以及将照片logo写入二维码中 * - * @param matrix 要写入的二维码 - * @param format 二维码照片格式 - * @param imagePath 二维码照片保存路径 - * @param logoPath logo路径 - * @param logoConfig logo配置对象 + * @param matrix + * 要写入的二维码 + * @param format + * 二维码照片格式 + * @param imagePath + * 二维码照片保存路径 + * @param logoPath + * logo路径 + * @param logoConfig + * logo配置对象 + * * @throws IOException */ @SuppressWarnings({"deprecation"}) @@ -216,10 +243,14 @@ public static void writeToFile(BitMatrix matrix, String format, String imagePath /** * 将照片logo添加到二维码中间 * - * @param image 生成的二维码照片对象 - * @param imagePath 照片保存路径 - * @param logoPath logo照片路径 - * @param formate 照片格式 + * @param image + * 生成的二维码照片对象 + * @param imagePath + * 照片保存路径 + * @param logoPath + * logo照片路径 + * @param formate + * 照片格式 */ public static void overlapImage(BufferedImage image, String formate, String imagePath, String logoPath, MatrixToLogoImageConfig logoConfig) throws IOException { BufferedImage logo = ImageIO.read(new File(logoPath)); diff --git a/common/src/main/java/pro/tools/data/image/ToolImageTailor.java b/common/src/main/java/pro/tools/data/image/ToolImageTailor.java index 6b8ebc7..2026bed 100644 --- a/common/src/main/java/pro/tools/data/image/ToolImageTailor.java +++ b/common/src/main/java/pro/tools/data/image/ToolImageTailor.java @@ -25,12 +25,17 @@ private ToolImageTailor() { /** * 裁剪 * - * @param srcPath 源图片路径名称如:c:/1.jpg - * @param savePath 剪切图片存放路径名称.如:c:/2.jpg - * @param x 剪切点x坐标 + * @param srcPath + * 源图片路径名称如:c:/1.jpg + * @param savePath + * 剪切图片存放路径名称.如:c:/2.jpg + * @param x + * 剪切点x坐标 * @param y - * @param width 剪切点大小 + * @param width + * 剪切点大小 * @param height + * * @throws IOException */ public static void cut(String srcPath, String savePath, int x, int y, int width, int height) throws IOException { @@ -52,26 +57,26 @@ public static void cut(String srcPath, String savePath, int x, int y, int width, ) { /* *

iis:读取源.true:只向前搜索

.将它标记为 ‘只向前搜索’。 此设置意味着包含在输入源中的图像将只按顺序读取,可能允许 reader 避免缓存包含与以前已经读取的图像关联的数据的那些输入部分。 - */ + */ reader.setInput(iis, true); - /* + /* *

描述如何对流进行解码的类

.用于指定如何在输入时从 Java Image I/O 框架的上下文中的流转换一幅图像或一组图像。用于特定图像格式的插件 将从其 ImageReader 实现的 getDefaultReadParam 方法中返回 - * ImageReadParam 的实例。 - */ + * ImageReadParam 的实例。 + */ ImageReadParam param = reader.getDefaultReadParam(); - /* + /* * 图片裁剪区域。Rectangle 指定了坐标空间中的一个区域,通过 Rectangle 对象 的左上顶点的坐标(x,y)、宽度和高度可以定义这个区域。 - */ + */ Rectangle rect = new Rectangle(x, y, width, height); // 提供一个 BufferedImage,将其用作解码像素数据的目标。 param.setSourceRegion(rect); - /* + /* * 使用所提供的 ImageReadParam 读取通过索引 imageIndex 指定的对象,并将 它作为一个完整的 BufferedImage 返回。 - */ + */ BufferedImage bi = reader.read(0, param); // 保存新图片 diff --git a/common/src/main/java/pro/tools/data/text/ToolJson.java b/common/src/main/java/pro/tools/data/text/ToolJson.java index 9b5f799..c665805 100644 --- a/common/src/main/java/pro/tools/data/text/ToolJson.java +++ b/common/src/main/java/pro/tools/data/text/ToolJson.java @@ -8,14 +8,22 @@ import org.google.gson.reflect.TypeToken; import pro.tools.data.decimal.Decimal; import pro.tools.data.text.json.TypeBuilder; -import pro.tools.data.text.json.typeadapter.*; +import pro.tools.data.text.json.typeadapter.BigDecimalTypeAdapter; +import pro.tools.data.text.json.typeadapter.DatePlusTypeAdapter; +import pro.tools.data.text.json.typeadapter.DecimalTypeAdapter; +import pro.tools.data.text.json.typeadapter.LocalDateTimeTypeAdapter; +import pro.tools.data.text.json.typeadapter.LocalDateTypeAdapter; +import pro.tools.data.text.json.typeadapter.TreeMapTypeAdapter; import pro.tools.time.DatePlus; import java.lang.reflect.Type; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; -import java.util.*; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; /** * 辅助类 @@ -75,6 +83,7 @@ public static GsonBuilder buildSimpleGsonBuilder() { * 将Map进行JSON编码 * * @param map + * * @return */ public static String mapToJson(Map map) { @@ -88,6 +97,7 @@ public static String mapToJson(Map map) { * 将Map进行JSON编码 * * @param json + * * @return */ public static Map jsonToMap(String json) { @@ -103,6 +113,7 @@ public static Map jsonToMap(String json) { * 将模型进行JSON编码 * * @param model + * * @return String */ public static String modelToJson(T model) { @@ -117,6 +128,7 @@ public static String modelToJson(T model) { * * @param sJson * @param classOfT + * * @return Object */ public static T jsonToModel(String sJson, Class classOfT) { @@ -128,6 +140,7 @@ public static T jsonToModel(String sJson, Class classOfT) { * * @param sJson * @param type + * * @return Object */ public static T jsonToAny(String sJson, Type type) { @@ -168,6 +181,7 @@ public static S anyToAny(T t, Type type) { * * @param data * @param classOfT + * * @return Object */ public static T mapToModel(Map data, Class classOfT) { @@ -179,6 +193,7 @@ public static T mapToModel(Map data, Class classOfT) { * * @param data * @param classOfT + * * @return Object */ public static List mapToModelList(Map data, Class classOfT) { @@ -189,6 +204,7 @@ public static List mapToModelList(Map data, Class classOfT) { * 将模型进行JSON解码 * * @param data + * * @return Object */ public static Map modelToMap(T data) { @@ -199,6 +215,7 @@ public static Map modelToMap(T data) { * 将模型进行JSON解码 * * @param data + * * @return Object */ public static List modelToMapList(T data) { @@ -210,6 +227,7 @@ public static List modelToMapList(T data) { * 将模型列表进行JSON解码 * * @param sJson + * * @return List */ public static List jsonToModelList(String sJson, Class classOfT) { @@ -231,6 +249,7 @@ public static List jsonToModelList(String sJson, Class classOfT) { * 将模型列表进行JSON解码 * * @param sJson + * * @return List */ public static List jsonToMapList(String sJson) { @@ -251,9 +270,13 @@ public static List jsonToMapList(String sJson) { /** * 把json数组转换成泛型T为类型的ArrayList * - * @param json Json数组 - * @param clazz 泛型类型的class - * @param 泛型类型 + * @param json + * Json数组 + * @param clazz + * 泛型类型的class + * @param + * 泛型类型 + * * @return 返回ArrayList */ public static ArrayList jsonToArrayList(String json, Class clazz) { @@ -271,7 +294,9 @@ public static ArrayList jsonToArrayList(String json, Class clazz) { /** * 把json数组转换成String类型的ArrayList * - * @param json json数组 + * @param json + * json数组 + * * @return 返回ArrayList */ public static ArrayList jsonToArrayList(String json) { @@ -290,6 +315,7 @@ public static ArrayList jsonToArrayList(String json) { * 将json列表转换为字符串列表,每个字符串为一个对象 * * @param json + * * @return List */ public static List dealJsonStr(String json) { diff --git a/common/src/main/java/pro/tools/data/text/ToolPinYin.java b/common/src/main/java/pro/tools/data/text/ToolPinYin.java index d7ba2e0..f9710db 100644 --- a/common/src/main/java/pro/tools/data/text/ToolPinYin.java +++ b/common/src/main/java/pro/tools/data/text/ToolPinYin.java @@ -23,6 +23,7 @@ private ToolPinYin() { * 得到 全拼 * * @param src + * * @return */ public static String getPinYin(String src) throws BadHanyuPinyinOutputFormatCombination { @@ -50,6 +51,7 @@ public static String getPinYin(String src) throws BadHanyuPinyinOutputFormatComb * 得到中文首字母 * * @param str + * * @return */ public static String getPinYinHeadChar(String str) { @@ -71,6 +73,7 @@ public static String getPinYinHeadChar(String str) { * 将字符串转移为ASCII码 * * @param cnStr + * * @return */ public static String getCnASCII(String cnStr) { diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java index a1214bf..3ef0c0d 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java @@ -14,7 +14,7 @@ *

* Create By 2017-10-24 17:14 */ -public class TreeMapTypeAdapter implements JsonDeserializer> { +public class TreeMapTypeAdapter implements JsonDeserializer> { @Override public TreeMap deserialize(JsonElement json, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException { diff --git a/common/src/main/java/pro/tools/file/ToolFileType.java b/common/src/main/java/pro/tools/file/ToolFileType.java index 52ecf6d..5698520 100644 --- a/common/src/main/java/pro/tools/file/ToolFileType.java +++ b/common/src/main/java/pro/tools/file/ToolFileType.java @@ -43,8 +43,11 @@ private ToolFileType() { /** * 得到文件头 * - * @param inputStream 文件路径 + * @param inputStream + * 文件路径 + * * @return 文件头 + * * @throws IOException */ private static String getFileContent(InputStream inputStream) throws IOException { @@ -69,7 +72,9 @@ private static String getFileContent(InputStream inputStream) throws IOException /** * 判断文件类型 * - * @param inputStream 文件流 + * @param inputStream + * 文件流 + * * @return 文件类型 */ public static FileType getType(InputStream inputStream) throws IOException { @@ -95,7 +100,9 @@ public static FileType getType(InputStream inputStream) throws IOException { /** * 判断文件类型 * - * @param filePath 文件路径 + * @param filePath + * 文件路径 + * * @return 文件类型 */ public static FileType getType(String filePath) throws IOException { @@ -105,10 +112,12 @@ public static FileType getType(String filePath) throws IOException { /** * 判断文件类型 * - * @param file 文件 + * @param file + * 文件 + * * @return 文件类型 */ public static FileType getType(File file) throws IOException { return getType(new FileInputStream(file)); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/common/src/main/java/pro/tools/path/ToolPath.java b/common/src/main/java/pro/tools/path/ToolPath.java index 8b49d69..a694d32 100644 --- a/common/src/main/java/pro/tools/path/ToolPath.java +++ b/common/src/main/java/pro/tools/path/ToolPath.java @@ -108,7 +108,7 @@ public static Path reName(Path path, String newName) throws IOException { public static Path createDir(Path path, boolean replace) throws IOException { if (replace) { rmr(path); - if(isDir(path)) { + if (isDir(path)) { path = path.getParent(); } return Files.createDirectories(path); @@ -116,7 +116,7 @@ public static Path createDir(Path path, boolean replace) throws IOException { if (isExists(path)) { return path; } else { - if(isDir(path)) { + if (isDir(path)) { path = path.getParent(); } return Files.createDirectories(path); diff --git a/common/src/main/java/pro/tools/script/ToolScript.java b/common/src/main/java/pro/tools/script/ToolScript.java index aa95462..386c122 100644 --- a/common/src/main/java/pro/tools/script/ToolScript.java +++ b/common/src/main/java/pro/tools/script/ToolScript.java @@ -27,6 +27,7 @@ private ToolScript() { * * @param templateContent * @param paramMap + * * @return */ public static String render(String templateContent, Map paramMap) throws ScriptException { @@ -73,9 +74,12 @@ public static String render(String templateContent, Map paramMap /** * 生成静态html * - * @param tlPath 模板路径 - * @param paramMap 参数 - * @param htmlPath html文件保存路径 + * @param tlPath + * 模板路径 + * @param paramMap + * 参数 + * @param htmlPath + * html文件保存路径 */ public static void makeHtml(String tlPath, Map paramMap, String htmlPath) throws ScriptException { String html = render(tlPath, paramMap); diff --git a/common/src/main/java/pro/tools/system/ToolOS.java b/common/src/main/java/pro/tools/system/ToolOS.java index 865d387..77c4830 100644 --- a/common/src/main/java/pro/tools/system/ToolOS.java +++ b/common/src/main/java/pro/tools/system/ToolOS.java @@ -62,6 +62,7 @@ private ToolOS() { * 获取java系统环境变量 * * @param key + * * @return */ public static String getOsSystemProperty(String key) { diff --git a/common/src/main/java/pro/tools/time/ToolLunar.java b/common/src/main/java/pro/tools/time/ToolLunar.java index c9ea674..4694848 100644 --- a/common/src/main/java/pro/tools/time/ToolLunar.java +++ b/common/src/main/java/pro/tools/time/ToolLunar.java @@ -59,9 +59,13 @@ private static int getBitInt(int data, int length, int shift) { /** * 从1582年10月开始算 * - * @param y 年 - * @param m 月 - * @param d 日 + * @param y + * 年 + * @param m + * 月 + * @param d + * 日 + * * @return 阳历 */ private static long solartoint(int y, int m, int d) { @@ -71,7 +75,9 @@ private static long solartoint(int y, int m, int d) { } /** - * @param lunarYear 农历年份 + * @param lunarYear + * 农历年份 + * * @return String of Ganzhi: 甲子年 Tiangan:甲乙丙丁戊己庚辛壬癸 * Dizhi: 子丑寅卯辰巳无为申酉戌亥 */ @@ -98,7 +104,9 @@ private static Solar solarfromint(long g) { /** * 农历转公历 * - * @param lunar 农历 + * @param lunar + * 农历 + * * @return 阴历 */ public static Solar lunartosolar(final Lunar lunar) { @@ -134,7 +142,9 @@ public static Solar lunartosolar(final Lunar lunar) { /** * 公历转农历 * - * @param solar 公历 + * @param solar + * 公历 + * * @return 阴历 */ public static Lunar solartolunar(final Solar solar) { diff --git a/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java b/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java index 5671a3d..ab904a8 100644 --- a/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java +++ b/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java @@ -25,7 +25,7 @@ public HttpClientChannelPoolHandler(SslContext sslCtx) { @Override public void channelCreated(Channel channel) { - NioSocketChannel nioSocketChannel = (NioSocketChannel)channel; + NioSocketChannel nioSocketChannel = (NioSocketChannel) channel; nioSocketChannel.config().setTcpNoDelay(true).setKeepAlive(true); // final ChannelPipeline p = channel.pipeline(); diff --git a/security/src/main/java/pro/tools/security/SecurityUrl.java b/security/src/main/java/pro/tools/security/SecurityUrl.java index a95e21d..2bf312a 100644 --- a/security/src/main/java/pro/tools/security/SecurityUrl.java +++ b/security/src/main/java/pro/tools/security/SecurityUrl.java @@ -22,7 +22,7 @@ public static String encode(String url, Charset charset) { } public static String encode(String url) { - return encode(url,StrConst.DEFAULT_CHARSET); + return encode(url, StrConst.DEFAULT_CHARSET); } public static String decode(String url, Charset charset) { diff --git a/security/src/main/java/pro/tools/security/ToolAES.java b/security/src/main/java/pro/tools/security/ToolAES.java index 243e9c3..5e1cedf 100644 --- a/security/src/main/java/pro/tools/security/ToolAES.java +++ b/security/src/main/java/pro/tools/security/ToolAES.java @@ -47,8 +47,11 @@ private ToolAES() { /** * 转换密钥 * - * @param key 二进制密钥 + * @param key + * 二进制密钥 + * * @return Key 密钥 + * * @throws Exception */ private static Key toKey(byte[] key) { @@ -61,18 +64,22 @@ private static Key toKey(byte[] key) { /** * 解密 * - * @param data 待解密数据 - * @param key 密钥 + * @param data + * 待解密数据 + * @param key + * 密钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { // 还原密钥 Key k = toKey(key); - /* + /* * 实例化 使用PKCS7Padding填充方式,按如下方式实现 Cipher.getInstance(CIPHER_ALGORITHM, "BC"); - */ + */ Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); // 初始化,设置为解密模式 @@ -85,19 +92,23 @@ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchPaddingExcept /** * 加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { // 还原密钥 Key k = toKey(key); - /* + /* * 实例化 使用PKCS7Padding填充方式,按如下方式实现 Cipher.getInstance(CIPHER_ALGORITHM, - * "BC"); - */ + * "BC"); + */ Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); // 初始化,设置为加密模式 @@ -111,15 +122,16 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingExcept * 生成密钥
* * @return byte[] 二进制密钥 + * * @throws Exception */ public static byte[] initKey() throws NoSuchAlgorithmException { // 实例化 KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM); - /* + /* * AES 要求密钥长度为 128位、192位或 256位 - */ + */ kg.init(256); // 生成秘密密钥 diff --git a/security/src/main/java/pro/tools/security/ToolBase64.java b/security/src/main/java/pro/tools/security/ToolBase64.java index 6255b38..80571b9 100644 --- a/security/src/main/java/pro/tools/security/ToolBase64.java +++ b/security/src/main/java/pro/tools/security/ToolBase64.java @@ -10,7 +10,7 @@ * Base64的加密解密 * * @author SeanDragon - * Create By 2017-04-20 14:43 + * Create By 2017-04-20 14:43 */ public final class ToolBase64 { private ToolBase64() { @@ -20,7 +20,9 @@ private ToolBase64() { /** * 功能:编码字符串 * - * @param data 源字符串 + * @param data + * 源字符串 + * * @return String */ public static String encode(String data) { @@ -30,7 +32,9 @@ public static String encode(String data) { /** * 功能:解码字符串 * - * @param data 源字符串 + * @param data + * 源字符串 + * * @return String */ public static String decode(String data) { @@ -40,7 +44,9 @@ public static String decode(String data) { /** * 功能:编码byte[] * - * @param data 源 + * @param data + * 源 + * * @return char[] */ public static char[] encode(byte[] data) { @@ -74,7 +80,9 @@ public static char[] encode(byte[] data) { /** * 功能:解码 * - * @param data 编码后的字符数组 + * @param data + * 编码后的字符数组 + * * @return byte[] */ public static byte[] decode(char[] data) { @@ -132,7 +140,8 @@ public static byte[] decode(char[] data) { /** * 功能:编码文件 * - * @param file 源文件 + * @param file + * 源文件 */ public static void encode(File file) throws IOException { if (!file.exists()) { @@ -147,7 +156,9 @@ public static void encode(File file) throws IOException { /** * 功能:解码文件。 * - * @param file 源文件 + * @param file + * 源文件 + * * @throws IOException */ public static void decode(File file) throws IOException { diff --git a/security/src/main/java/pro/tools/security/ToolCertificate.java b/security/src/main/java/pro/tools/security/ToolCertificate.java index 0de52c5..cc097d6 100644 --- a/security/src/main/java/pro/tools/security/ToolCertificate.java +++ b/security/src/main/java/pro/tools/security/ToolCertificate.java @@ -36,10 +36,15 @@ private ToolCertificate() { /** * 由KeyStore获得私钥 * - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return PrivateKey 私钥 + * * @throws Exception */ private static PrivateKey getPrivateKeyByKeyStore(String keyStorePath, String alias, String password) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, UnrecoverableKeyException { @@ -55,8 +60,11 @@ private static PrivateKey getPrivateKeyByKeyStore(String keyStorePath, String al /** * 由Certificate获得公钥 * - * @param certificatePath 证书路径 + * @param certificatePath + * 证书路径 + * * @return PublicKey 公钥 + * * @throws Exception */ private static PublicKey getPublicKeyByCertificate(String certificatePath) throws CertificateException, IOException { @@ -72,8 +80,11 @@ private static PublicKey getPublicKeyByCertificate(String certificatePath) throw /** * 获得Certificate * - * @param certificatePath 证书路径 + * @param certificatePath + * 证书路径 + * * @return Certificate 证书 + * * @throws Exception */ private static Certificate getCertificate(String certificatePath) throws CertificateException, IOException { @@ -96,10 +107,15 @@ private static Certificate getCertificate(String certificatePath) throws Certifi /** * 获得Certificate * - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return Certificate 证书 + * * @throws Exception */ private static Certificate getCertificate(String keyStorePath, String alias, String password) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { @@ -114,9 +130,13 @@ private static Certificate getCertificate(String keyStorePath, String alias, Str /** * 获得KeyStore * - * @param keyStorePath 密钥库路径 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param password + * 密码 + * * @return KeyStore 密钥库 + * * @throws Exception */ private static KeyStore getKeyStore(String keyStorePath, String password) throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException { @@ -126,11 +146,17 @@ private static KeyStore getKeyStore(String keyStorePath, String password) throws /** * 私钥加密 * - * @param data 待加密数据 - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param data + * 待加密数据 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPrivateKey(byte[] data, String keyStorePath, String alias, String password) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, UnrecoverableKeyException, CertificateException, KeyStoreException, IOException { @@ -149,11 +175,17 @@ public static byte[] encryptByPrivateKey(byte[] data, String keyStorePath, Strin /** * 私钥解密 * - * @param data 待解密数据 - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param data + * 待解密数据 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPrivateKey(byte[] data, String keyStorePath, String alias, String password) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, UnrecoverableKeyException, CertificateException, KeyStoreException, IOException { @@ -172,9 +204,13 @@ public static byte[] decryptByPrivateKey(byte[] data, String keyStorePath, Strin /** * 公钥加密 * - * @param data 待加密数据 - * @param certificatePath 证书路径 + * @param data + * 待加密数据 + * @param certificatePath + * 证书路径 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPublicKey(byte[] data, String certificatePath) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, CertificateException, IOException { @@ -193,9 +229,13 @@ public static byte[] encryptByPublicKey(byte[] data, String certificatePath) thr /** * 公钥解密 * - * @param data 待解密数据 - * @param certificatePath 证书路径 + * @param data + * 待解密数据 + * @param certificatePath + * 证书路径 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPublicKey(byte[] data, String certificatePath) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, CertificateException, IOException { @@ -214,10 +254,15 @@ public static byte[] decryptByPublicKey(byte[] data, String certificatePath) thr /** * 签名 * - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return byte[] 签名 + * * @throws Exception */ public static byte[] sign(byte[] sign, String keyStorePath, String alias, String password) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, CertificateException, KeyStoreException, IOException, UnrecoverableKeyException { @@ -242,10 +287,15 @@ public static byte[] sign(byte[] sign, String keyStorePath, String alias, String /** * 验证签名 * - * @param data 数据 - * @param sign 签名 - * @param certificatePath 证书路径 + * @param data + * 数据 + * @param sign + * 签名 + * @param certificatePath + * 证书路径 + * * @return boolean 验证通过为真 + * * @throws Exception */ public static boolean verify(byte[] data, byte[] sign, String certificatePath) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, CertificateException, IOException { diff --git a/security/src/main/java/pro/tools/security/ToolCertificate2.java b/security/src/main/java/pro/tools/security/ToolCertificate2.java index b05e4f3..d197689 100644 --- a/security/src/main/java/pro/tools/security/ToolCertificate2.java +++ b/security/src/main/java/pro/tools/security/ToolCertificate2.java @@ -41,10 +41,15 @@ private ToolCertificate2() { /** * 由KeyStore获得私钥 * - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return PrivateKey 私钥 + * * @throws Exception */ public static PrivateKey getPrivateKeyByKeyStore(String keyStorePath, String alias, String password) throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, IOException, CertificateException { @@ -60,8 +65,11 @@ public static PrivateKey getPrivateKeyByKeyStore(String keyStorePath, String ali /** * 由Certificate获得公钥 * - * @param certificatePath 证书路径 + * @param certificatePath + * 证书路径 + * * @return PublicKey 公钥 + * * @throws Exception */ public static PublicKey getPublicKeyByCertificate(String certificatePath) throws CertificateException, IOException { @@ -77,8 +85,11 @@ public static PublicKey getPublicKeyByCertificate(String certificatePath) throws /** * 获得Certificate * - * @param certificatePath 证书路径 + * @param certificatePath + * 证书路径 + * * @return Certificate 证书 + * * @throws Exception */ private static X509Certificate getCertificate(String certificatePath) throws CertificateException, IOException { @@ -98,9 +109,13 @@ private static X509Certificate getCertificate(String certificatePath) throws Cer /** * 获得KeyStore * - * @param keyStorePath 密钥库路径 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param password + * 密码 + * * @return KeyStore 密钥库 + * * @throws Exception */ private static KeyStore getKeyStore(String keyStorePath, String password) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { @@ -120,11 +135,17 @@ private static KeyStore getKeyStore(String keyStorePath, String password) throws /** * 私钥加密 * - * @param data 待加密数据 - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param data + * 待加密数据 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPrivateKey(byte[] data, String keyStorePath, String alias, String password) throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, IOException, CertificateException { @@ -143,11 +164,17 @@ public static byte[] encryptByPrivateKey(byte[] data, String keyStorePath, Strin /** * 私钥解密 * - * @param data 待解密数据 - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param data + * 待解密数据 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPrivateKey(byte[] data, String keyStorePath, String alias, String password) throws UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, IOException, CertificateException { @@ -166,9 +193,13 @@ public static byte[] decryptByPrivateKey(byte[] data, String keyStorePath, Strin /** * 公钥加密 * - * @param data 待加密数据 - * @param certificatePath 证书路径 + * @param data + * 待加密数据 + * @param certificatePath + * 证书路径 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPublicKey(byte[] data, String certificatePath) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, CertificateException, IOException { @@ -187,9 +218,13 @@ public static byte[] encryptByPublicKey(byte[] data, String certificatePath) thr /** * 公钥解密 * - * @param data 待解密数据 - * @param certificatePath 证书路径 + * @param data + * 待解密数据 + * @param certificatePath + * 证书路径 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPublicKey(byte[] data, String certificatePath) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, CertificateException, IOException { @@ -208,10 +243,15 @@ public static byte[] decryptByPublicKey(byte[] data, String certificatePath) thr /** * 签名 * - * @param keyStorePath 密钥库路径 - * @param alias 别名 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param alias + * 别名 + * @param password + * 密码 + * * @return byte[] 签名 + * * @throws Exception */ public static byte[] sign(byte[] sign, String keyStorePath, String alias, String password, String certificatePath) throws CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableKeyException, KeyStoreException, InvalidKeyException, SignatureException { @@ -236,10 +276,15 @@ public static byte[] sign(byte[] sign, String keyStorePath, String alias, String /** * 验证签名 * - * @param data 数据 - * @param sign 签名 - * @param certificatePath 证书路径 + * @param data + * 数据 + * @param sign + * 签名 + * @param certificatePath + * 证书路径 + * * @return boolean 验证通过为真 + * * @throws Exception */ public static boolean verify(byte[] data, byte[] sign, String certificatePath) throws CertificateException, IOException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { diff --git a/security/src/main/java/pro/tools/security/ToolDES.java b/security/src/main/java/pro/tools/security/ToolDES.java index 3334596..939fe5f 100644 --- a/security/src/main/java/pro/tools/security/ToolDES.java +++ b/security/src/main/java/pro/tools/security/ToolDES.java @@ -38,8 +38,11 @@ private ToolDES() { /** * 转换密钥 * - * @param key 二进制密钥 + * @param key + * 二进制密钥 + * * @return Key 密钥 + * * @throws Exception */ private static Key toKey(byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException { @@ -59,9 +62,13 @@ private static Key toKey(byte[] key) throws InvalidKeyException, NoSuchAlgorithm /** * 解密 * - * @param data 待解密数据 - * @param key 密钥 + * @param data + * 待解密数据 + * @param key + * 密钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException { @@ -82,9 +89,13 @@ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce /** * 加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException { @@ -108,21 +119,22 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce * Bouncy Castle 支持64bit密钥
* * @return byte[] 二进制密钥 + * * @throws Exception */ public static byte[] initKey() throws NoSuchAlgorithmException { - /* + /* * 实例化密钥生成器 - * - * 若要使用64bit密钥注意替换 将下述代码中的KeyGenerator.getInstance(CIPHER_ALGORITHM); - * 替换为KeyGenerator.getInstance(CIPHER_ALGORITHM, "BC"); - */ + * + * 若要使用64bit密钥注意替换 将下述代码中的KeyGenerator.getInstance(CIPHER_ALGORITHM); + * 替换为KeyGenerator.getInstance(CIPHER_ALGORITHM, "BC"); + */ KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM); - /* + /* * 初始化密钥生成器 若要使用64bit密钥注意替换 将下述代码kg.init(56); 替换为kg.init(64); - */ + */ kg.init(56, new SecureRandom()); // 生成秘密密钥 diff --git a/security/src/main/java/pro/tools/security/ToolDESede.java b/security/src/main/java/pro/tools/security/ToolDESede.java index df9cbf1..4f3b1c9 100644 --- a/security/src/main/java/pro/tools/security/ToolDESede.java +++ b/security/src/main/java/pro/tools/security/ToolDESede.java @@ -35,8 +35,11 @@ private ToolDESede() { /** * 转换密钥 * - * @param key 二进制密钥 + * @param key + * 二进制密钥 + * * @return Key 密钥 + * * @throws Exception */ private static Key toKey(byte[] key) throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException { @@ -56,9 +59,13 @@ private static Key toKey(byte[] key) throws InvalidKeyException, NoSuchAlgorithm /** * 解密 * - * @param data 待解密数据 - * @param key 密钥 + * @param data + * 待解密数据 + * @param key + * 密钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException { @@ -66,9 +73,9 @@ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce // 还原密钥 Key k = toKey(key); - /* + /* * 实例化 使用PKCS7Padding填充方式 Cipher.getInstance(CIPHER_ALGORITHM, "BC"); - */ + */ Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); // 初始化,设置为解密模式 @@ -81,9 +88,13 @@ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce /** * 加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException, InvalidKeySpecException, NoSuchPaddingException, BadPaddingException, IllegalBlockSizeException { @@ -91,9 +102,9 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce // 还原密钥 Key k = toKey(key); - /* + /* * 实例化 使用PKCS7Padding填充方式 Cipher.getInstance(CIPHER_ALGORITHM, "BC"); - */ + */ Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); // 初始化,设置为加密模式 @@ -107,6 +118,7 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce * 生成密钥
* * @return byte[] 二进制密钥 + * * @throws Exception */ public static byte[] initKey() throws NoSuchAlgorithmException { @@ -114,9 +126,9 @@ public static byte[] initKey() throws NoSuchAlgorithmException { // 实例化 KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM); - /* + /* * DESede 要求密钥长度为 112位或168位 - */ + */ kg.init(168); // 生成秘密密钥 diff --git a/security/src/main/java/pro/tools/security/ToolDH.java b/security/src/main/java/pro/tools/security/ToolDH.java index e5ad0e3..cce4387 100644 --- a/security/src/main/java/pro/tools/security/ToolDH.java +++ b/security/src/main/java/pro/tools/security/ToolDH.java @@ -65,6 +65,7 @@ private ToolDH() { * 初始化甲方密钥 * * @return Map 甲方密钥Map + * * @throws Exception */ public static Map initKey() throws NoSuchAlgorithmException { @@ -96,8 +97,11 @@ public static Map initKey() throws NoSuchAlgorithmException { /** * 初始化乙方密钥 * - * @param key 甲方公钥 + * @param key + * 甲方公钥 + * * @return Map 乙方密钥Map + * * @throws Exception */ public static Map initKey(byte[] key) throws NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeySpecException { @@ -142,9 +146,13 @@ public static Map initKey(byte[] key) throws NoSuchAlgorithmExce /** * 加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -163,9 +171,13 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingExcept /** * 解密
* - * @param data 待解密数据 - * @param key 密钥 + * @param data + * 待解密数据 + * @param key + * 密钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -184,9 +196,13 @@ public static byte[] decrypt(byte[] data, byte[] key) throws NoSuchPaddingExcept /** * 构建密钥 * - * @param publicKey 公钥 - * @param privateKey 私钥 + * @param publicKey + * 公钥 + * @param privateKey + * 私钥 + * * @return byte[] 本地密钥 + * * @throws Exception */ public static byte[] getSecretKey(byte[] publicKey, byte[] privateKey) throws InvalidKeySpecException, NoSuchAlgorithmException, InvalidKeyException { @@ -225,8 +241,11 @@ public static byte[] getSecretKey(byte[] publicKey, byte[] privateKey) throws In /** * 取得私钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 私钥 + * * @throws Exception */ public static byte[] getPrivateKey(Map keyMap) { @@ -239,8 +258,11 @@ public static byte[] getPrivateKey(Map keyMap) { /** * 取得公钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 公钥 + * * @throws Exception */ public static byte[] getPublicKey(Map keyMap) { diff --git a/security/src/main/java/pro/tools/security/ToolDSA.java b/security/src/main/java/pro/tools/security/ToolDSA.java index b7d68b8..aa9a5ac 100644 --- a/security/src/main/java/pro/tools/security/ToolDSA.java +++ b/security/src/main/java/pro/tools/security/ToolDSA.java @@ -56,9 +56,13 @@ private ToolDSA() { /** * 签名 * - * @param data 待签名数据 - * @param privateKey 私钥 + * @param data + * 待签名数据 + * @param privateKey + * 私钥 + * * @return byte[] 数字签名 + * * @throws Exception */ public static byte[] sign(byte[] data, byte[] privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException { @@ -88,10 +92,15 @@ public static byte[] sign(byte[] data, byte[] privateKey) throws NoSuchAlgorithm /** * 校验 * - * @param data 待校验数据 - * @param publicKey 公钥 - * @param sign 数字签名 + * @param data + * 待校验数据 + * @param publicKey + * 公钥 + * @param sign + * 数字签名 + * * @return boolean 校验成功返回true 失败返回false + * * @throws Exception */ public static boolean verify(byte[] data, byte[] publicKey, byte[] sign) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException { @@ -122,6 +131,7 @@ public static boolean verify(byte[] data, byte[] publicKey, byte[] sign) throws * 生成密钥 * * @return 密钥对象 + * * @throws Exception */ public static Map initKey() throws NoSuchAlgorithmException { @@ -150,8 +160,11 @@ public static Map initKey() throws NoSuchAlgorithmException { /** * 取得私钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 私钥 + * * @throws Exception */ public static byte[] getPrivateKey(Map keyMap) { @@ -162,8 +175,11 @@ public static byte[] getPrivateKey(Map keyMap) { /** * 取得公钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 公钥 + * * @throws Exception */ public static byte[] getPublicKey(Map keyMap) { diff --git a/security/src/main/java/pro/tools/security/ToolECDSA.java b/security/src/main/java/pro/tools/security/ToolECDSA.java index db0aca7..72d498c 100644 --- a/security/src/main/java/pro/tools/security/ToolECDSA.java +++ b/security/src/main/java/pro/tools/security/ToolECDSA.java @@ -69,6 +69,7 @@ private ToolECDSA() { * 初始化密钥 * * @return Map 密钥Map + * * @throws Exception */ public static Map initKey() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException { @@ -120,8 +121,11 @@ public static Map initKey() throws NoSuchAlgorithmException, Inv /** * 取得私钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 私钥 + * * @throws Exception */ public static byte[] getPrivateKey(Map keyMap) { @@ -132,8 +136,11 @@ public static byte[] getPrivateKey(Map keyMap) { /** * 取得公钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 公钥 + * * @throws Exception */ public static byte[] getPublicKey(Map keyMap) { @@ -144,9 +151,13 @@ public static byte[] getPublicKey(Map keyMap) { /** * 签名 * - * @param data 待签名数据 - * @param privateKey 私钥 + * @param data + * 待签名数据 + * @param privateKey + * 私钥 + * * @return byte[] 数字签名 + * * @throws Exception */ public static byte[] sign(byte[] data, byte[] privateKey) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException { @@ -178,10 +189,15 @@ public static byte[] sign(byte[] data, byte[] privateKey) throws NoSuchAlgorithm /** * 校验 * - * @param data 待校验数据 - * @param publicKey 公钥 - * @param sign 数字签名 + * @param data + * 待校验数据 + * @param publicKey + * 公钥 + * @param sign + * 数字签名 + * * @return boolean 校验成功返回true 失败返回false + * * @throws Exception */ public static boolean verify(byte[] data, byte[] publicKey, byte[] sign) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException { diff --git a/security/src/main/java/pro/tools/security/ToolElGamal.java b/security/src/main/java/pro/tools/security/ToolElGamal.java index 98c7fcc..34a6f7a 100644 --- a/security/src/main/java/pro/tools/security/ToolElGamal.java +++ b/security/src/main/java/pro/tools/security/ToolElGamal.java @@ -60,9 +60,13 @@ private ToolElGamal() { /** * 用私钥解密 * - * @param data 待解密数据 - * @param key 私钥 + * @param data + * 待解密数据 + * @param key + * 私钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPrivateKey(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -89,9 +93,13 @@ public static byte[] decryptByPrivateKey(byte[] data, byte[] key) throws NoSuchA /** * 用公钥加密 * - * @param data 待加密数据 - * @param key 公钥 + * @param data + * 待加密数据 + * @param key + * 公钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPublicKey(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -119,6 +127,7 @@ public static byte[] encryptByPublicKey(byte[] data, byte[] key) throws NoSuchAl * 生成密钥 * * @return Map 密钥Map + * * @throws Exception */ public static Map initKey() throws NoSuchAlgorithmException, InvalidParameterSpecException, InvalidAlgorithmParameterException { @@ -164,8 +173,11 @@ public static Map initKey() throws NoSuchAlgorithmException, Inv /** * 取得私钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 私钥 + * * @throws Exception */ public static byte[] getPrivateKey(Map keyMap) { @@ -177,7 +189,9 @@ public static byte[] getPrivateKey(Map keyMap) { * 取得公钥 * * @param keyMap + * * @return + * * @throws Exception */ public static byte[] getPublicKey(Map keyMap) { diff --git a/security/src/main/java/pro/tools/security/ToolHTTPS.java b/security/src/main/java/pro/tools/security/ToolHTTPS.java index fe59ca0..36d4854 100644 --- a/security/src/main/java/pro/tools/security/ToolHTTPS.java +++ b/security/src/main/java/pro/tools/security/ToolHTTPS.java @@ -31,9 +31,13 @@ private ToolHTTPS() { /** * 获得KeyStore * - * @param keyStorePath 密钥库路径 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param password + * 密码 + * * @return KeyStore 密钥库 + * * @throws Exception */ static KeyStore getKeyStore(String keyStorePath, String password) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { @@ -56,10 +60,15 @@ static KeyStore getKeyStore(String keyStorePath, String password) throws KeyStor /** * 获得SSLSocektFactory * - * @param password 密码 - * @param keyStorePath 密钥库路径 - * @param trustStorePath 信任库路径 + * @param password + * 密码 + * @param keyStorePath + * 密钥库路径 + * @param trustStorePath + * 信任库路径 + * * @return SSLSocketFactory + * * @throws Exception */ static SSLSocketFactory getSSLSocketFactory(String password, String keyStorePath, String trustStorePath) throws NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException, UnrecoverableKeyException, KeyManagementException { @@ -97,10 +106,15 @@ static SSLSocketFactory getSSLSocketFactory(String password, String keyStorePath /** * 为HttpsURLConnection配置SSLSocketFactory * - * @param conn HttpsURLConnection - * @param password 密码 - * @param keyStorePath 密钥库路径 - * @param trustKeyStorePath 信任库路径 + * @param conn + * HttpsURLConnection + * @param password + * 密码 + * @param keyStorePath + * 密钥库路径 + * @param trustKeyStorePath + * 信任库路径 + * * @throws Exception */ public static void configSSLSocketFactory(HttpsURLConnection conn, String password, String keyStorePath, diff --git a/security/src/main/java/pro/tools/security/ToolHTTPS2.java b/security/src/main/java/pro/tools/security/ToolHTTPS2.java index 556fb9c..97387d7 100644 --- a/security/src/main/java/pro/tools/security/ToolHTTPS2.java +++ b/security/src/main/java/pro/tools/security/ToolHTTPS2.java @@ -22,9 +22,13 @@ private ToolHTTPS2() { /** * 获得KeyStore * - * @param keyStorePath 密钥库路径 - * @param password 密码 + * @param keyStorePath + * 密钥库路径 + * @param password + * 密码 + * * @return KeyStore 密钥库 + * * @throws Exception */ private static KeyStore getKeyStore(String keyStorePath, String password) throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { @@ -48,10 +52,15 @@ private static KeyStore getKeyStore(String keyStorePath, String password) throws /** * 获得SSLSocektFactory * - * @param password 密码 - * @param keyStorePath 密钥库路径 - * @param trustStorePath 信任库路径 + * @param password + * 密码 + * @param keyStorePath + * 密钥库路径 + * @param trustStorePath + * 信任库路径 + * * @return SSLSocketFactory + * * @throws Exception */ private static SSLSocketFactory getSSLSocketFactory(String password, String keyStorePath, String trustStorePath) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { @@ -61,10 +70,15 @@ private static SSLSocketFactory getSSLSocketFactory(String password, String keyS /** * 为HttpsURLConnection配置SSLSocketFactory * - * @param conn HttpsURLConnection - * @param password 密码 - * @param keyStorePath 密钥库路径 - * @param trustKeyStorePath 信任库路径 + * @param conn + * HttpsURLConnection + * @param password + * 密码 + * @param keyStorePath + * 密钥库路径 + * @param trustKeyStorePath + * 信任库路径 + * * @throws Exception */ public static void configSSLSocketFactory(HttpsURLConnection conn, String password, String keyStorePath, diff --git a/security/src/main/java/pro/tools/security/ToolIDEA.java b/security/src/main/java/pro/tools/security/ToolIDEA.java index e05c784..0176ec3 100644 --- a/security/src/main/java/pro/tools/security/ToolIDEA.java +++ b/security/src/main/java/pro/tools/security/ToolIDEA.java @@ -44,8 +44,11 @@ private ToolIDEA() { /** * 转换密钥 * - * @param key 二进制密钥 + * @param key + * 二进制密钥 + * * @return Key 密钥 + * * @throws Exception */ private static Key toKey(byte[] key) { @@ -58,9 +61,13 @@ private static Key toKey(byte[] key) { /** * 解密 * - * @param data 待解密数据 - * @param key 密钥 + * @param data + * 待解密数据 + * @param key + * 密钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decrypt(byte[] data, byte[] key) throws InvalidKeyException, BadPaddingException, IllegalBlockSizeException, NoSuchPaddingException, NoSuchAlgorithmException { @@ -80,9 +87,13 @@ public static byte[] decrypt(byte[] data, byte[] key) throws InvalidKeyException /** * 加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -103,6 +114,7 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchPaddingExcept * 生成密钥
* * @return byte[] 二进制密钥 + * * @throws Exception */ public static byte[] initKey() throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/ToolPBE.java b/security/src/main/java/pro/tools/security/ToolPBE.java index c9cbaa4..b456b67 100644 --- a/security/src/main/java/pro/tools/security/ToolPBE.java +++ b/security/src/main/java/pro/tools/security/ToolPBE.java @@ -59,6 +59,7 @@ private ToolPBE() { * 盐长度必须为8字节 * * @return byte[] 盐 + * * @throws Exception */ public static byte[] initSalt() { @@ -69,8 +70,11 @@ public static byte[] initSalt() { /** * 转换密钥 * - * @param password 密码 + * @param password + * 密码 + * * @return Key 密钥 + * * @throws Exception */ private static Key toKey(String password) throws NoSuchAlgorithmException, InvalidKeySpecException { @@ -89,10 +93,15 @@ private static Key toKey(String password) throws NoSuchAlgorithmException, Inval /** * 加密 * - * @param data 数据 - * @param password 密码 - * @param salt 盐 + * @param data + * 数据 + * @param password + * 密码 + * @param salt + * 盐 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encrypt(byte[] data, String password, byte[] salt) throws InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -117,10 +126,15 @@ public static byte[] encrypt(byte[] data, String password, byte[] salt) throws I /** * 解密 * - * @param data 数据 - * @param password 密码 - * @param salt 盐 + * @param data + * 数据 + * @param password + * 密码 + * @param salt + * 盐 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decrypt(byte[] data, String password, byte[] salt) throws InvalidKeySpecException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { diff --git a/security/src/main/java/pro/tools/security/ToolPBE2.java b/security/src/main/java/pro/tools/security/ToolPBE2.java index 32f8905..781bf0e 100644 --- a/security/src/main/java/pro/tools/security/ToolPBE2.java +++ b/security/src/main/java/pro/tools/security/ToolPBE2.java @@ -39,26 +39,35 @@ private ToolPBE2() { /** * 对输入的密码进行验证 * - * @param attemptedPassword 待验证的密码 - * @param encryptedPassword 密文 - * @param salt 盐值 + * @param attemptedPassword + * 待验证的密码 + * @param encryptedPassword + * 密文 + * @param salt + * 盐值 + * * @return 是否验证成功 + * * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ public static boolean authenticate(String attemptedPassword, String encryptedPassword, String salt) throws InvalidKeySpecException, NoSuchAlgorithmException { - // 用相同的盐值对用户输入的密码进行加密 + // 用相同的盐值对用户输入的密码进行加密 String encryptedAttemptedPassword = getEncryptedPassword(attemptedPassword, salt); - // 把加密后的密文和原密文进行比较,相同则验证成功,否则失败 + // 把加密后的密文和原密文进行比较,相同则验证成功,否则失败 return encryptedAttemptedPassword.equals(encryptedPassword); } /** * 生成密文 * - * @param password 明文密码 - * @param salt 盐值 + * @param password + * 明文密码 + * @param salt + * 盐值 + * * @return + * * @throws NoSuchAlgorithmException * @throws InvalidKeySpecException */ @@ -73,6 +82,7 @@ public static String getEncryptedPassword(String password, String salt) throws N * 通过提供加密的强随机数生成器 生成盐 * * @return + * * @throws NoSuchAlgorithmException */ public static String generateSalt() throws NoSuchAlgorithmException { @@ -85,7 +95,9 @@ public static String generateSalt() throws NoSuchAlgorithmException { /** * 十六进制字符串转二进制字符串 * - * @param hex the hex string + * @param hex + * the hex string + * * @return the hex string decoded into a byte array */ private static byte[] fromHex(String hex) { @@ -99,7 +111,9 @@ private static byte[] fromHex(String hex) { /** * 二进制字符串转十六进制字符串 * - * @param array the byte array to ToolJson + * @param array + * the byte array to ToolJson + * * @return a length*2 character string encoding the byte array */ private static String toHex(byte[] array) { diff --git a/security/src/main/java/pro/tools/security/ToolRSA.java b/security/src/main/java/pro/tools/security/ToolRSA.java index e22201d..ac4071f 100644 --- a/security/src/main/java/pro/tools/security/ToolRSA.java +++ b/security/src/main/java/pro/tools/security/ToolRSA.java @@ -23,6 +23,7 @@ /** * RSA安全编码组件 + * * @author SeanDragon */ public final class ToolRSA { @@ -53,9 +54,13 @@ private ToolRSA() { /** * 私钥解密 * - * @param data 待解密数据 - * @param key 私钥 + * @param data + * 待解密数据 + * @param key + * 私钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPrivateKey(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -78,9 +83,13 @@ public static byte[] decryptByPrivateKey(byte[] data, byte[] key) throws NoSuchA /** * 公钥解密 * - * @param data 待解密数据 - * @param key 公钥 + * @param data + * 待解密数据 + * @param key + * 公钥 + * * @return byte[] 解密数据 + * * @throws Exception */ public static byte[] decryptByPublicKey(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -104,9 +113,13 @@ public static byte[] decryptByPublicKey(byte[] data, byte[] key) throws NoSuchAl /** * 公钥加密 * - * @param data 待加密数据 - * @param key 公钥 + * @param data + * 待加密数据 + * @param key + * 公钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPublicKey(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -128,9 +141,13 @@ public static byte[] encryptByPublicKey(byte[] data, byte[] key) throws NoSuchAl /** * 私钥加密 * - * @param data 待加密数据 - * @param key 私钥 + * @param data + * 待加密数据 + * @param key + * 私钥 + * * @return byte[] 加密数据 + * * @throws Exception */ public static byte[] encryptByPrivateKey(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException { @@ -153,8 +170,11 @@ public static byte[] encryptByPrivateKey(byte[] data, byte[] key) throws NoSuchA /** * 取得私钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 私钥 + * * @throws Exception */ public static byte[] getPrivateKey(Map keyMap) { @@ -165,8 +185,11 @@ public static byte[] getPrivateKey(Map keyMap) { /** * 取得公钥 * - * @param keyMap 密钥Map + * @param keyMap + * 密钥Map + * * @return byte[] 公钥 + * * @throws Exception */ public static byte[] getPublicKey(Map keyMap) { @@ -178,6 +201,7 @@ public static byte[] getPublicKey(Map keyMap) { * 初始化密钥 * * @return Map 密钥Map + * * @throws Exception */ public static Map initKey() throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java b/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java index 91829e9..e0c07cc 100644 --- a/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java @@ -25,6 +25,7 @@ private ToolHmacRipeMD() { * 初始化HmacRipeMD128密钥 * * @return byte[] 密钥 + * * @throws NoSuchAlgorithmException */ public static byte[] initHmacRipeMD128Key() throws NoSuchAlgorithmException { @@ -45,9 +46,13 @@ public static byte[] initHmacRipeMD128Key() throws NoSuchAlgorithmException { /** * HmacRipeMD128消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacRipeMD128(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException { @@ -71,9 +76,13 @@ public static byte[] encodeHmacRipeMD128(byte[] data, byte[] key) throws NoSuchA /** * HmacRipeMD128Hex消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeHmacRipeMD128Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException { @@ -89,6 +98,7 @@ public static String encodeHmacRipeMD128Hex(byte[] data, byte[] key) throws Inva * 初始化HmacRipeMD160密钥 * * @return byte[] 密钥 + * * @throws Exception */ public static byte[] initHmacRipeMD160Key() throws NoSuchAlgorithmException { @@ -109,9 +119,13 @@ public static byte[] initHmacRipeMD160Key() throws NoSuchAlgorithmException { /** * HmacRipeMD160消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacRipeMD160(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException { @@ -135,9 +149,13 @@ public static byte[] encodeHmacRipeMD160(byte[] data, byte[] key) throws NoSuchA /** * HmacRipeMD160Hex消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return String 消息摘要 + * * @throws Exception */ public static String encodeHmacRipeMD160Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolMAC.java b/security/src/main/java/pro/tools/security/md/ToolMAC.java index 9ec7a9c..1e825ed 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMAC.java +++ b/security/src/main/java/pro/tools/security/md/ToolMAC.java @@ -21,6 +21,7 @@ private ToolMAC() { * 初始化HmacMD5密钥 * * @return + * * @throws Exception */ public static byte[] initHmacMD5Key() throws NoSuchAlgorithmException { @@ -38,9 +39,13 @@ public static byte[] initHmacMD5Key() throws NoSuchAlgorithmException { /** * HmacMD5加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacMD5(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException { @@ -62,6 +67,7 @@ public static byte[] encodeHmacMD5(byte[] data, byte[] key) throws NoSuchAlgorit * 初始化HmacSHA1密钥 * * @return + * * @throws Exception */ public static byte[] initHmacSHAKey() throws NoSuchAlgorithmException { @@ -79,9 +85,13 @@ public static byte[] initHmacSHAKey() throws NoSuchAlgorithmException { /** * HmacSHA1加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacSHA(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException { @@ -100,12 +110,13 @@ public static byte[] encodeHmacSHA(byte[] data, byte[] key) throws NoSuchAlgorit } // // 根据所安装的 JCE 仲裁策略文件,返回指定转换的最大密钥长度。 -// public final static int getMaxAllowedKeyLength(String transformation) +// public final static int getMaxAllowedKeyLength(String transformation) /** * 初始化HmacSHA256密钥 * * @return + * * @throws Exception */ public static byte[] initHmacSHA256Key() throws NoSuchAlgorithmException { @@ -123,9 +134,13 @@ public static byte[] initHmacSHA256Key() throws NoSuchAlgorithmException { /** * HmacSHA256加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacSHA256(byte[] data, byte[] key) @@ -148,6 +163,7 @@ public static byte[] encodeHmacSHA256(byte[] data, byte[] key) * 初始化HmacSHA384密钥 * * @return + * * @throws Exception */ public static byte[] initHmacSHA384Key() throws NoSuchAlgorithmException { @@ -165,9 +181,13 @@ public static byte[] initHmacSHA384Key() throws NoSuchAlgorithmException { /** * HmacSHA384加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacSHA384(byte[] data, byte[] key) @@ -190,6 +210,7 @@ public static byte[] encodeHmacSHA384(byte[] data, byte[] key) * 初始化HmacSHA512密钥 * * @return + * * @throws Exception */ public static byte[] initHmacSHA512Key() throws NoSuchAlgorithmException { @@ -207,9 +228,13 @@ public static byte[] initHmacSHA512Key() throws NoSuchAlgorithmException { /** * HmacSHA512加密 * - * @param data 待加密数据 - * @param key 密钥 + * @param data + * 待加密数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacSHA512(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException { diff --git a/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java b/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java index bb519c8..213e3ea 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java +++ b/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java @@ -24,6 +24,7 @@ private ToolMAC_BCP() { * 初始化HmacMD2密钥 * * @return byte[] 密钥 + * * @throws Exception */ public static byte[] initHmacMD2Key() throws NoSuchAlgorithmException { @@ -44,9 +45,13 @@ public static byte[] initHmacMD2Key() throws NoSuchAlgorithmException { /** * HmacMD2消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacMD2(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException { @@ -70,9 +75,13 @@ public static byte[] encodeHmacMD2(byte[] data, byte[] key) throws NoSuchAlgorit /** * HmacMD2Hex消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeHmacMD2Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException { @@ -88,6 +97,7 @@ public static String encodeHmacMD2Hex(byte[] data, byte[] key) throws InvalidKey * 初始化HmacMD4密钥 * * @return byte[] 密钥 + * * @throws Exception */ public static byte[] initHmacMD4Key() throws NoSuchAlgorithmException { @@ -108,9 +118,13 @@ public static byte[] initHmacMD4Key() throws NoSuchAlgorithmException { /** * HmacMD4消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeHmacMD4(byte[] data, byte[] key) @@ -135,9 +149,13 @@ public static byte[] encodeHmacMD4(byte[] data, byte[] key) /** * HmacMD4Hex消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return String 消息摘要 + * * @throws Exception */ public static String encodeHmacMD4Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException { @@ -153,6 +171,7 @@ public static String encodeHmacMD4Hex(byte[] data, byte[] key) throws InvalidKey * 初始化HmacSHA224密钥 * * @return byte[] 密钥 + * * @throws Exception */ public static byte[] initHmacSHA224Key() throws NoSuchAlgorithmException { @@ -173,9 +192,13 @@ public static byte[] initHmacSHA224Key() throws NoSuchAlgorithmException { /** * HmacSHA224消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return byte[] 消息摘要 + * * @throws NoSuchAlgorithmException * @throws InvalidKeyException */ @@ -200,9 +223,13 @@ public static byte[] encodeHmacSHA224(byte[] data, byte[] key) throws NoSuchAlgo /** * HmacSHA224Hex消息摘要 * - * @param data 待做消息摘要处理的数据 - * @param key 密钥 + * @param data + * 待做消息摘要处理的数据 + * @param key + * 密钥 + * * @return String 消息摘要 + * * @throws Exception */ public static String encodeHmacSHA224Hex(byte[] data, byte[] key) throws InvalidKeyException, NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD.java b/security/src/main/java/pro/tools/security/md/ToolMD.java index bdebcaf..aec67ce 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD.java @@ -21,8 +21,11 @@ private ToolMD() { /** * Tiger加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeTiger(byte[] data) throws NoSuchAlgorithmException { @@ -40,8 +43,11 @@ public static byte[] encodeTiger(byte[] data) throws NoSuchAlgorithmException { /** * TigerHex加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeTigerHex(byte[] data) throws NoSuchAlgorithmException { @@ -56,8 +62,11 @@ public static String encodeTigerHex(byte[] data) throws NoSuchAlgorithmException /** * Whirlpool加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeWhirlpool(byte[] data) throws NoSuchAlgorithmException { @@ -75,8 +84,11 @@ public static byte[] encodeWhirlpool(byte[] data) throws NoSuchAlgorithmExceptio /** * WhirlpoolHex加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeWhirlpoolHex(byte[] data) throws NoSuchAlgorithmException { @@ -91,8 +103,11 @@ public static String encodeWhirlpoolHex(byte[] data) throws NoSuchAlgorithmExcep /** * GOST3411加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeGOST3411(byte[] data) throws NoSuchAlgorithmException { @@ -110,8 +125,11 @@ public static byte[] encodeGOST3411(byte[] data) throws NoSuchAlgorithmException /** * GOST3411Hex加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeGOST3411Hex(byte[] data) throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD2.java b/security/src/main/java/pro/tools/security/md/ToolMD2.java index 55885e7..2904ebf 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD2.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD2.java @@ -16,8 +16,11 @@ private ToolMD2() { /** * MD2加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeMD2(byte[] data) throws NoSuchAlgorithmException { @@ -31,8 +34,11 @@ public static byte[] encodeMD2(byte[] data) throws NoSuchAlgorithmException { /** * MD2加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeMD2Hex(byte[] data) throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD4.java b/security/src/main/java/pro/tools/security/md/ToolMD4.java index d0e738f..4b08169 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD4.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD4.java @@ -18,8 +18,11 @@ private ToolMD4() { /** * MD4加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeMD4(byte[] data) throws NoSuchAlgorithmException { @@ -37,8 +40,11 @@ public static byte[] encodeMD4(byte[] data) throws NoSuchAlgorithmException { /** * MD4加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return String 消息摘要 + * * @throws Exception */ public static String encodeMD4Hex(byte[] data) throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD5.java b/security/src/main/java/pro/tools/security/md/ToolMD5.java index 43141fa..905f576 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD5.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD5.java @@ -18,8 +18,11 @@ private ToolMD5() { /** * MD5加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws NoSuchAlgorithmException */ public static byte[] encodeMD5(byte[] data) throws NoSuchAlgorithmException { @@ -36,8 +39,11 @@ public static byte[] encodeMD5(byte[] data) throws NoSuchAlgorithmException { /** * MD5加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return String 消息摘要 + * * @throws NoSuchAlgorithmException */ public static String encodeMD5Hex(byte[] data) throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolRipeMD.java b/security/src/main/java/pro/tools/security/md/ToolRipeMD.java index 80147a8..28c9ec9 100644 --- a/security/src/main/java/pro/tools/security/md/ToolRipeMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolRipeMD.java @@ -19,8 +19,11 @@ private ToolRipeMD() { /** * RipeMD128消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeRipeMD128(byte[] data) throws NoSuchAlgorithmException { @@ -38,8 +41,11 @@ public static byte[] encodeRipeMD128(byte[] data) throws NoSuchAlgorithmExceptio /** * RipeMD128Hex消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeRipeMD128Hex(byte[] data) throws NoSuchAlgorithmException { @@ -54,8 +60,11 @@ public static String encodeRipeMD128Hex(byte[] data) throws NoSuchAlgorithmExcep /** * RipeMD160消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeRipeMD160(byte[] data) throws NoSuchAlgorithmException { @@ -73,8 +82,11 @@ public static byte[] encodeRipeMD160(byte[] data) throws NoSuchAlgorithmExceptio /** * RipeMD160Hex消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeRipeMD160Hex(byte[] data) throws NoSuchAlgorithmException { @@ -89,8 +101,11 @@ public static String encodeRipeMD160Hex(byte[] data) throws NoSuchAlgorithmExcep /** * RipeMD256消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeRipeMD256(byte[] data) throws NoSuchAlgorithmException { @@ -108,8 +123,11 @@ public static byte[] encodeRipeMD256(byte[] data) throws NoSuchAlgorithmExceptio /** * RipeMD256Hex消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeRipeMD256Hex(byte[] data) throws NoSuchAlgorithmException { @@ -124,8 +142,11 @@ public static String encodeRipeMD256Hex(byte[] data) throws NoSuchAlgorithmExcep /** * RipeMD320消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeRipeMD320(byte[] data) throws NoSuchAlgorithmException { @@ -143,8 +164,11 @@ public static byte[] encodeRipeMD320(byte[] data) throws NoSuchAlgorithmExceptio /** * RipeMD320Hex消息摘要 * - * @param data 待做消息摘要处理的数据 + * @param data + * 待做消息摘要处理的数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeRipeMD320Hex(byte[] data) throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolSHA1.java b/security/src/main/java/pro/tools/security/md/ToolSHA1.java index abe1b35..9be9f16 100644 --- a/security/src/main/java/pro/tools/security/md/ToolSHA1.java +++ b/security/src/main/java/pro/tools/security/md/ToolSHA1.java @@ -16,8 +16,11 @@ private ToolSHA1() { /** * SHA-1加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeSHA(byte[] data) throws NoSuchAlgorithmException { @@ -31,8 +34,11 @@ public static byte[] encodeSHA(byte[] data) throws NoSuchAlgorithmException { /** * SHA-1加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeSHAHex(byte[] data) throws NoSuchAlgorithmException { diff --git a/security/src/main/java/pro/tools/security/md/ToolSHA2.java b/security/src/main/java/pro/tools/security/md/ToolSHA2.java index 77d9189..4b1e48e 100644 --- a/security/src/main/java/pro/tools/security/md/ToolSHA2.java +++ b/security/src/main/java/pro/tools/security/md/ToolSHA2.java @@ -18,8 +18,11 @@ private ToolSHA2() { /** * SHA-224加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeSHA224(byte[] data) throws NoSuchAlgorithmException { @@ -36,8 +39,11 @@ public static byte[] encodeSHA224(byte[] data) throws NoSuchAlgorithmException { /** * SHA-224加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeSHA224Hex(byte[] data) throws NoSuchAlgorithmException { @@ -51,8 +57,11 @@ public static String encodeSHA224Hex(byte[] data) throws NoSuchAlgorithmExceptio /** * SHA-256加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeSHA256(byte[] data) throws NoSuchAlgorithmException { @@ -66,8 +75,11 @@ public static byte[] encodeSHA256(byte[] data) throws NoSuchAlgorithmException { /** * SHA-256加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeSHA256Hex(byte[] data) throws NoSuchAlgorithmException { @@ -81,8 +93,11 @@ public static String encodeSHA256Hex(byte[] data) throws NoSuchAlgorithmExceptio /** * SHA-384加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeSHA384(byte[] data) throws NoSuchAlgorithmException { @@ -96,8 +111,11 @@ public static byte[] encodeSHA384(byte[] data) throws NoSuchAlgorithmException { /** * SHA-384加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeSHA384Hex(byte[] data) throws NoSuchAlgorithmException { @@ -111,8 +129,11 @@ public static String encodeSHA384Hex(byte[] data) throws NoSuchAlgorithmExceptio /** * SHA-512加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static byte[] encodeSHA512(byte[] data) throws NoSuchAlgorithmException { @@ -126,8 +147,11 @@ public static byte[] encodeSHA512(byte[] data) throws NoSuchAlgorithmException { /** * SHA-512加密 * - * @param data 待加密数据 + * @param data + * 待加密数据 + * * @return byte[] 消息摘要 + * * @throws Exception */ public static String encodeSHA512Hex(byte[] data) throws NoSuchAlgorithmException { From 58f6fa85d65915cc8b485dbb71fae22c98a78421 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 18:55:33 +0800 Subject: [PATCH 25/69] =?UTF-8?q?1=20=E5=B0=86=E4=B8=80=E4=BA=9B=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=BF=A1=E6=81=AF=E5=8F=98=E4=B8=BA=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/java/pro/tools/constant/RegexConst.java | 2 +- common/src/main/java/pro/tools/constant/StrConst.java | 2 +- common/src/main/java/pro/tools/constant/UnitConst.java | 2 +- common/src/main/java/pro/tools/data/ToolSerialize.java | 2 +- common/src/main/java/pro/tools/data/decimal/ToolDecimal.java | 2 +- common/src/main/java/pro/tools/data/image/ToolBarCode.java | 2 +- .../src/main/java/pro/tools/data/image/ToolImagePressText.java | 2 +- common/src/main/java/pro/tools/data/image/ToolImageResize.java | 2 +- common/src/main/java/pro/tools/data/image/ToolImageTailor.java | 2 +- common/src/main/java/pro/tools/data/text/ToolConvert.java | 2 +- common/src/main/java/pro/tools/data/text/ToolPinYin.java | 2 +- common/src/main/java/pro/tools/data/text/ToolRandoms.java | 2 +- common/src/main/java/pro/tools/data/text/ToolRegex.java | 2 +- common/src/main/java/pro/tools/data/text/ToolStr.java | 2 +- common/src/main/java/pro/tools/file/ToolFile.java | 2 +- common/src/main/java/pro/tools/file/ToolZip.java | 2 +- common/src/main/java/pro/tools/format/ToolFormat.java | 2 +- common/src/main/java/pro/tools/format/ToolFormatJson.java | 2 +- common/src/main/java/pro/tools/script/ToolScript.java | 2 +- common/src/main/java/pro/tools/system/ToolClassSearch.java | 2 +- common/src/main/java/pro/tools/system/ToolMaven.java | 2 +- common/src/main/java/pro/tools/system/ToolOS.java | 2 +- common/src/main/java/pro/tools/system/ToolShell.java | 2 +- common/src/main/java/pro/tools/system/ToolSystem.java | 2 +- common/src/main/java/pro/tools/time/ToolDatePlus.java | 2 +- common/src/main/java/pro/tools/time/ToolLunar.java | 2 +- http/src/main/java/pro/tools/http/jdk/ToolHttp.java | 2 +- security/src/main/java/pro/tools/security/ToolAES.java | 2 +- security/src/main/java/pro/tools/security/ToolBase64.java | 2 +- security/src/main/java/pro/tools/security/ToolCertificate.java | 2 +- security/src/main/java/pro/tools/security/ToolCertificate2.java | 2 +- security/src/main/java/pro/tools/security/ToolDES.java | 2 +- security/src/main/java/pro/tools/security/ToolDESede.java | 2 +- security/src/main/java/pro/tools/security/ToolDH.java | 2 +- security/src/main/java/pro/tools/security/ToolDSA.java | 2 +- security/src/main/java/pro/tools/security/ToolECDSA.java | 2 +- security/src/main/java/pro/tools/security/ToolElGamal.java | 2 +- security/src/main/java/pro/tools/security/ToolHTTPS.java | 2 +- security/src/main/java/pro/tools/security/ToolHTTPS2.java | 2 +- security/src/main/java/pro/tools/security/ToolIDEA.java | 2 +- security/src/main/java/pro/tools/security/ToolPBE.java | 2 +- security/src/main/java/pro/tools/security/ToolPBE2.java | 2 +- security/src/main/java/pro/tools/security/ToolPbkdf2.java | 2 +- security/src/main/java/pro/tools/security/ToolRSA.java | 2 +- .../src/main/java/pro/tools/security/md/ToolHmacRipeMD.java | 2 +- security/src/main/java/pro/tools/security/md/ToolMAC.java | 2 +- security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java | 2 +- security/src/main/java/pro/tools/security/md/ToolMD.java | 2 +- security/src/main/java/pro/tools/security/md/ToolMD2.java | 2 +- security/src/main/java/pro/tools/security/md/ToolMD4.java | 2 +- security/src/main/java/pro/tools/security/md/ToolMD5.java | 2 +- security/src/main/java/pro/tools/security/md/ToolRipeMD.java | 2 +- security/src/main/java/pro/tools/security/md/ToolSHA1.java | 2 +- security/src/main/java/pro/tools/security/md/ToolSHA2.java | 2 +- 54 files changed, 54 insertions(+), 54 deletions(-) diff --git a/common/src/main/java/pro/tools/constant/RegexConst.java b/common/src/main/java/pro/tools/constant/RegexConst.java index baa7ed3..835a980 100644 --- a/common/src/main/java/pro/tools/constant/RegexConst.java +++ b/common/src/main/java/pro/tools/constant/RegexConst.java @@ -114,7 +114,7 @@ public final class RegexConst { public static final Pattern REGEX_NEGATIVE_FLOAT = compile("^-[1-9]\\d*\\.\\d*|-0\\.\\d*[1-9]\\d*$"); private RegexConst() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } //endregion diff --git a/common/src/main/java/pro/tools/constant/StrConst.java b/common/src/main/java/pro/tools/constant/StrConst.java index af912af..c2570ce 100644 --- a/common/src/main/java/pro/tools/constant/StrConst.java +++ b/common/src/main/java/pro/tools/constant/StrConst.java @@ -12,7 +12,7 @@ public final class StrConst { private StrConst() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/constant/UnitConst.java b/common/src/main/java/pro/tools/constant/UnitConst.java index d7c0cbf..9821498 100644 --- a/common/src/main/java/pro/tools/constant/UnitConst.java +++ b/common/src/main/java/pro/tools/constant/UnitConst.java @@ -12,7 +12,7 @@ public final class UnitConst { private UnitConst() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } //region 存储相关常量 diff --git a/common/src/main/java/pro/tools/data/ToolSerialize.java b/common/src/main/java/pro/tools/data/ToolSerialize.java index 7f0d20a..b0d4481 100644 --- a/common/src/main/java/pro/tools/data/ToolSerialize.java +++ b/common/src/main/java/pro/tools/data/ToolSerialize.java @@ -10,7 +10,7 @@ public final class ToolSerialize { private ToolSerialize() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } private static FSTConfiguration CONFIGURATION = FSTConfiguration diff --git a/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java b/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java index 18b1a5e..79709c4 100644 --- a/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java +++ b/common/src/main/java/pro/tools/data/decimal/ToolDecimal.java @@ -17,7 +17,7 @@ public final class ToolDecimal { private ToolDecimal() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } private final static BigInteger HUNDRED = BigInteger.valueOf(100); diff --git a/common/src/main/java/pro/tools/data/image/ToolBarCode.java b/common/src/main/java/pro/tools/data/image/ToolBarCode.java index 8ffd183..08783e5 100644 --- a/common/src/main/java/pro/tools/data/image/ToolBarCode.java +++ b/common/src/main/java/pro/tools/data/image/ToolBarCode.java @@ -32,7 +32,7 @@ public final class ToolBarCode { private ToolBarCode() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/image/ToolImagePressText.java b/common/src/main/java/pro/tools/data/image/ToolImagePressText.java index 9072647..1064f84 100644 --- a/common/src/main/java/pro/tools/data/image/ToolImagePressText.java +++ b/common/src/main/java/pro/tools/data/image/ToolImagePressText.java @@ -15,7 +15,7 @@ public final class ToolImagePressText { private ToolImagePressText() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/image/ToolImageResize.java b/common/src/main/java/pro/tools/data/image/ToolImageResize.java index 76fd572..c295e3a 100644 --- a/common/src/main/java/pro/tools/data/image/ToolImageResize.java +++ b/common/src/main/java/pro/tools/data/image/ToolImageResize.java @@ -28,7 +28,7 @@ public final class ToolImageResize { private ToolImageResize() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } public static final MediaTracker TRACKER = new MediaTracker(new Component() { diff --git a/common/src/main/java/pro/tools/data/image/ToolImageTailor.java b/common/src/main/java/pro/tools/data/image/ToolImageTailor.java index 2026bed..4970ee3 100644 --- a/common/src/main/java/pro/tools/data/image/ToolImageTailor.java +++ b/common/src/main/java/pro/tools/data/image/ToolImageTailor.java @@ -19,7 +19,7 @@ public final class ToolImageTailor { private ToolImageTailor() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/text/ToolConvert.java b/common/src/main/java/pro/tools/data/text/ToolConvert.java index 6494072..9131493 100644 --- a/common/src/main/java/pro/tools/data/text/ToolConvert.java +++ b/common/src/main/java/pro/tools/data/text/ToolConvert.java @@ -21,7 +21,7 @@ public final class ToolConvert { private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; private ToolConvert() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/text/ToolPinYin.java b/common/src/main/java/pro/tools/data/text/ToolPinYin.java index f9710db..9d6faf3 100644 --- a/common/src/main/java/pro/tools/data/text/ToolPinYin.java +++ b/common/src/main/java/pro/tools/data/text/ToolPinYin.java @@ -16,7 +16,7 @@ public final class ToolPinYin { private ToolPinYin() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/text/ToolRandoms.java b/common/src/main/java/pro/tools/data/text/ToolRandoms.java index a0ee85f..a41ecc4 100644 --- a/common/src/main/java/pro/tools/data/text/ToolRandoms.java +++ b/common/src/main/java/pro/tools/data/text/ToolRandoms.java @@ -11,7 +11,7 @@ */ public final class ToolRandoms { private ToolRandoms() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/text/ToolRegex.java b/common/src/main/java/pro/tools/data/text/ToolRegex.java index a531096..2a0cc79 100644 --- a/common/src/main/java/pro/tools/data/text/ToolRegex.java +++ b/common/src/main/java/pro/tools/data/text/ToolRegex.java @@ -29,7 +29,7 @@ public final class ToolRegex { private ToolRegex() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/data/text/ToolStr.java b/common/src/main/java/pro/tools/data/text/ToolStr.java index 4e6cb4b..cfb9ca5 100644 --- a/common/src/main/java/pro/tools/data/text/ToolStr.java +++ b/common/src/main/java/pro/tools/data/text/ToolStr.java @@ -10,7 +10,7 @@ public final class ToolStr { private ToolStr() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } diff --git a/common/src/main/java/pro/tools/file/ToolFile.java b/common/src/main/java/pro/tools/file/ToolFile.java index b697560..480db42 100644 --- a/common/src/main/java/pro/tools/file/ToolFile.java +++ b/common/src/main/java/pro/tools/file/ToolFile.java @@ -33,7 +33,7 @@ public final class ToolFile { private ToolFile() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/file/ToolZip.java b/common/src/main/java/pro/tools/file/ToolZip.java index 0184347..41fe086 100644 --- a/common/src/main/java/pro/tools/file/ToolZip.java +++ b/common/src/main/java/pro/tools/file/ToolZip.java @@ -34,7 +34,7 @@ public final class ToolZip { private ToolZip() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/format/ToolFormat.java b/common/src/main/java/pro/tools/format/ToolFormat.java index eb51343..8dc3a7b 100644 --- a/common/src/main/java/pro/tools/format/ToolFormat.java +++ b/common/src/main/java/pro/tools/format/ToolFormat.java @@ -9,7 +9,7 @@ public final class ToolFormat { private ToolFormat() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/format/ToolFormatJson.java b/common/src/main/java/pro/tools/format/ToolFormatJson.java index c48455b..ed3d2e2 100644 --- a/common/src/main/java/pro/tools/format/ToolFormatJson.java +++ b/common/src/main/java/pro/tools/format/ToolFormatJson.java @@ -8,7 +8,7 @@ public final class ToolFormatJson { private ToolFormatJson() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } diff --git a/common/src/main/java/pro/tools/script/ToolScript.java b/common/src/main/java/pro/tools/script/ToolScript.java index 386c122..8e33888 100644 --- a/common/src/main/java/pro/tools/script/ToolScript.java +++ b/common/src/main/java/pro/tools/script/ToolScript.java @@ -16,7 +16,7 @@ public final class ToolScript { private ToolScript() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } diff --git a/common/src/main/java/pro/tools/system/ToolClassSearch.java b/common/src/main/java/pro/tools/system/ToolClassSearch.java index 66cf0c9..36d9dc2 100644 --- a/common/src/main/java/pro/tools/system/ToolClassSearch.java +++ b/common/src/main/java/pro/tools/system/ToolClassSearch.java @@ -24,7 +24,7 @@ public final class ToolClassSearch { } private ToolClassSearch() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } public static void init() { diff --git a/common/src/main/java/pro/tools/system/ToolMaven.java b/common/src/main/java/pro/tools/system/ToolMaven.java index 58bf7e0..b1ed41e 100644 --- a/common/src/main/java/pro/tools/system/ToolMaven.java +++ b/common/src/main/java/pro/tools/system/ToolMaven.java @@ -10,7 +10,7 @@ */ public final class ToolMaven { private ToolMaven() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } public static boolean install(String groupId, String artifactId, String version, String fileName) throws IOException { diff --git a/common/src/main/java/pro/tools/system/ToolOS.java b/common/src/main/java/pro/tools/system/ToolOS.java index 77c4830..24a2a25 100644 --- a/common/src/main/java/pro/tools/system/ToolOS.java +++ b/common/src/main/java/pro/tools/system/ToolOS.java @@ -55,7 +55,7 @@ public final class ToolOS { } private ToolOS() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/system/ToolShell.java b/common/src/main/java/pro/tools/system/ToolShell.java index 380366d..64e4622 100644 --- a/common/src/main/java/pro/tools/system/ToolShell.java +++ b/common/src/main/java/pro/tools/system/ToolShell.java @@ -17,7 +17,7 @@ public final class ToolShell { private ToolShell() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/common/src/main/java/pro/tools/system/ToolSystem.java b/common/src/main/java/pro/tools/system/ToolSystem.java index 09a73c6..bc25ce5 100644 --- a/common/src/main/java/pro/tools/system/ToolSystem.java +++ b/common/src/main/java/pro/tools/system/ToolSystem.java @@ -12,7 +12,7 @@ public final class ToolSystem { private static Boolean haveDiskD; private ToolSystem() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } public static boolean isWindows() { diff --git a/common/src/main/java/pro/tools/time/ToolDatePlus.java b/common/src/main/java/pro/tools/time/ToolDatePlus.java index 6554f1d..873e84e 100644 --- a/common/src/main/java/pro/tools/time/ToolDatePlus.java +++ b/common/src/main/java/pro/tools/time/ToolDatePlus.java @@ -19,7 +19,7 @@ public final class ToolDatePlus { private ToolDatePlus() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } private static volatile ZoneId DEFAULT_ZONE_ID = ZoneId.systemDefault(); diff --git a/common/src/main/java/pro/tools/time/ToolLunar.java b/common/src/main/java/pro/tools/time/ToolLunar.java index 4694848..b5c456a 100644 --- a/common/src/main/java/pro/tools/time/ToolLunar.java +++ b/common/src/main/java/pro/tools/time/ToolLunar.java @@ -7,7 +7,7 @@ */ public final class ToolLunar { private ToolLunar() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/http/src/main/java/pro/tools/http/jdk/ToolHttp.java b/http/src/main/java/pro/tools/http/jdk/ToolHttp.java index feb5ef2..9dee090 100644 --- a/http/src/main/java/pro/tools/http/jdk/ToolHttp.java +++ b/http/src/main/java/pro/tools/http/jdk/ToolHttp.java @@ -37,7 +37,7 @@ public final class ToolHttp { private static HttpBuilder builder = new HttpBuilder(); private ToolHttp() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } public static HttpReceive sendGet(String url) { diff --git a/security/src/main/java/pro/tools/security/ToolAES.java b/security/src/main/java/pro/tools/security/ToolAES.java index 5e1cedf..2284d31 100644 --- a/security/src/main/java/pro/tools/security/ToolAES.java +++ b/security/src/main/java/pro/tools/security/ToolAES.java @@ -29,7 +29,7 @@ */ public final class ToolAES { private ToolAES() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolBase64.java b/security/src/main/java/pro/tools/security/ToolBase64.java index 80571b9..2864d65 100644 --- a/security/src/main/java/pro/tools/security/ToolBase64.java +++ b/security/src/main/java/pro/tools/security/ToolBase64.java @@ -14,7 +14,7 @@ */ public final class ToolBase64 { private ToolBase64() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolCertificate.java b/security/src/main/java/pro/tools/security/ToolCertificate.java index cc097d6..775cf7f 100644 --- a/security/src/main/java/pro/tools/security/ToolCertificate.java +++ b/security/src/main/java/pro/tools/security/ToolCertificate.java @@ -25,7 +25,7 @@ */ public final class ToolCertificate { private ToolCertificate() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolCertificate2.java b/security/src/main/java/pro/tools/security/ToolCertificate2.java index d197689..df4a45c 100644 --- a/security/src/main/java/pro/tools/security/ToolCertificate2.java +++ b/security/src/main/java/pro/tools/security/ToolCertificate2.java @@ -25,7 +25,7 @@ */ public final class ToolCertificate2 { private ToolCertificate2() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolDES.java b/security/src/main/java/pro/tools/security/ToolDES.java index 939fe5f..cbd5e9c 100644 --- a/security/src/main/java/pro/tools/security/ToolDES.java +++ b/security/src/main/java/pro/tools/security/ToolDES.java @@ -20,7 +20,7 @@ public final class ToolDES { private ToolDES() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolDESede.java b/security/src/main/java/pro/tools/security/ToolDESede.java index 4f3b1c9..f10692d 100644 --- a/security/src/main/java/pro/tools/security/ToolDESede.java +++ b/security/src/main/java/pro/tools/security/ToolDESede.java @@ -18,7 +18,7 @@ */ public final class ToolDESede { private ToolDESede() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolDH.java b/security/src/main/java/pro/tools/security/ToolDH.java index cce4387..f9da31c 100644 --- a/security/src/main/java/pro/tools/security/ToolDH.java +++ b/security/src/main/java/pro/tools/security/ToolDH.java @@ -31,7 +31,7 @@ */ public final class ToolDH { private ToolDH() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolDSA.java b/security/src/main/java/pro/tools/security/ToolDSA.java index aa9a5ac..01aea10 100644 --- a/security/src/main/java/pro/tools/security/ToolDSA.java +++ b/security/src/main/java/pro/tools/security/ToolDSA.java @@ -25,7 +25,7 @@ */ public final class ToolDSA { private ToolDSA() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolECDSA.java b/security/src/main/java/pro/tools/security/ToolECDSA.java index 72d498c..105a0de 100644 --- a/security/src/main/java/pro/tools/security/ToolECDSA.java +++ b/security/src/main/java/pro/tools/security/ToolECDSA.java @@ -33,7 +33,7 @@ */ public final class ToolECDSA { private ToolECDSA() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolElGamal.java b/security/src/main/java/pro/tools/security/ToolElGamal.java index 34a6f7a..97e1d46 100644 --- a/security/src/main/java/pro/tools/security/ToolElGamal.java +++ b/security/src/main/java/pro/tools/security/ToolElGamal.java @@ -32,7 +32,7 @@ */ public final class ToolElGamal { private ToolElGamal() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolHTTPS.java b/security/src/main/java/pro/tools/security/ToolHTTPS.java index 36d4854..bcd8d78 100644 --- a/security/src/main/java/pro/tools/security/ToolHTTPS.java +++ b/security/src/main/java/pro/tools/security/ToolHTTPS.java @@ -20,7 +20,7 @@ */ public final class ToolHTTPS { private ToolHTTPS() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolHTTPS2.java b/security/src/main/java/pro/tools/security/ToolHTTPS2.java index 97387d7..281d12f 100644 --- a/security/src/main/java/pro/tools/security/ToolHTTPS2.java +++ b/security/src/main/java/pro/tools/security/ToolHTTPS2.java @@ -16,7 +16,7 @@ */ public final class ToolHTTPS2 { private ToolHTTPS2() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolIDEA.java b/security/src/main/java/pro/tools/security/ToolIDEA.java index 0176ec3..4f42733 100644 --- a/security/src/main/java/pro/tools/security/ToolIDEA.java +++ b/security/src/main/java/pro/tools/security/ToolIDEA.java @@ -23,7 +23,7 @@ */ public final class ToolIDEA { private ToolIDEA() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolPBE.java b/security/src/main/java/pro/tools/security/ToolPBE.java index b456b67..d133020 100644 --- a/security/src/main/java/pro/tools/security/ToolPBE.java +++ b/security/src/main/java/pro/tools/security/ToolPBE.java @@ -23,7 +23,7 @@ */ public final class ToolPBE { private ToolPBE() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/ToolPBE2.java b/security/src/main/java/pro/tools/security/ToolPBE2.java index 781bf0e..9f5b054 100644 --- a/security/src/main/java/pro/tools/security/ToolPBE2.java +++ b/security/src/main/java/pro/tools/security/ToolPBE2.java @@ -16,7 +16,7 @@ */ public final class ToolPBE2 { private ToolPBE2() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } private static final String PBKDF2_ALGORITHM = "PBKDF2WithHmacSHA1"; diff --git a/security/src/main/java/pro/tools/security/ToolPbkdf2.java b/security/src/main/java/pro/tools/security/ToolPbkdf2.java index 162c234..0353499 100644 --- a/security/src/main/java/pro/tools/security/ToolPbkdf2.java +++ b/security/src/main/java/pro/tools/security/ToolPbkdf2.java @@ -23,7 +23,7 @@ */ public final class ToolPbkdf2 { private ToolPbkdf2() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } public static boolean authenticate(String attemptedPassword, byte[] encryptedPassword, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException { diff --git a/security/src/main/java/pro/tools/security/ToolRSA.java b/security/src/main/java/pro/tools/security/ToolRSA.java index ac4071f..70e8b60 100644 --- a/security/src/main/java/pro/tools/security/ToolRSA.java +++ b/security/src/main/java/pro/tools/security/ToolRSA.java @@ -28,7 +28,7 @@ */ public final class ToolRSA { private ToolRSA() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java b/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java index e0c07cc..d766f58 100644 --- a/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java @@ -18,7 +18,7 @@ public final class ToolHmacRipeMD { private ToolHmacRipeMD() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolMAC.java b/security/src/main/java/pro/tools/security/md/ToolMAC.java index 1e825ed..5f960fd 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMAC.java +++ b/security/src/main/java/pro/tools/security/md/ToolMAC.java @@ -14,7 +14,7 @@ public final class ToolMAC { private ToolMAC() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java b/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java index 213e3ea..a29213b 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java +++ b/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java @@ -17,7 +17,7 @@ public final class ToolMAC_BCP { private ToolMAC_BCP() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolMD.java b/security/src/main/java/pro/tools/security/md/ToolMD.java index aec67ce..e5ec6fe 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD.java @@ -14,7 +14,7 @@ public final class ToolMD { private ToolMD() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } diff --git a/security/src/main/java/pro/tools/security/md/ToolMD2.java b/security/src/main/java/pro/tools/security/md/ToolMD2.java index 2904ebf..d4dc015 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD2.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD2.java @@ -10,7 +10,7 @@ */ public final class ToolMD2 { private ToolMD2() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolMD4.java b/security/src/main/java/pro/tools/security/md/ToolMD4.java index 4b08169..9ab0b57 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD4.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD4.java @@ -12,7 +12,7 @@ */ public final class ToolMD4 { private ToolMD4() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolMD5.java b/security/src/main/java/pro/tools/security/md/ToolMD5.java index 905f576..0e1f6bb 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD5.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD5.java @@ -12,7 +12,7 @@ */ public final class ToolMD5 { private ToolMD5() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolRipeMD.java b/security/src/main/java/pro/tools/security/md/ToolRipeMD.java index 28c9ec9..a9b233b 100644 --- a/security/src/main/java/pro/tools/security/md/ToolRipeMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolRipeMD.java @@ -13,7 +13,7 @@ */ public final class ToolRipeMD { private ToolRipeMD() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolSHA1.java b/security/src/main/java/pro/tools/security/md/ToolSHA1.java index 9be9f16..d48b50b 100644 --- a/security/src/main/java/pro/tools/security/md/ToolSHA1.java +++ b/security/src/main/java/pro/tools/security/md/ToolSHA1.java @@ -10,7 +10,7 @@ */ public final class ToolSHA1 { private ToolSHA1() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** diff --git a/security/src/main/java/pro/tools/security/md/ToolSHA2.java b/security/src/main/java/pro/tools/security/md/ToolSHA2.java index 4b1e48e..17df751 100644 --- a/security/src/main/java/pro/tools/security/md/ToolSHA2.java +++ b/security/src/main/java/pro/tools/security/md/ToolSHA2.java @@ -12,7 +12,7 @@ */ public final class ToolSHA2 { private ToolSHA2() { - throw new UnsupportedOperationException("u can't instantiate me..."); + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** From f85ae8f9997f3cb9d1509d802976ba6fbb836b73 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 19:53:03 +0800 Subject: [PATCH 26/69] =?UTF-8?q?1=20=E4=BF=AE=E5=A4=8DToolScript=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/java/pro/tools/script/ToolScript.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/pro/tools/script/ToolScript.java b/common/src/main/java/pro/tools/script/ToolScript.java index 8e33888..0c68054 100644 --- a/common/src/main/java/pro/tools/script/ToolScript.java +++ b/common/src/main/java/pro/tools/script/ToolScript.java @@ -1,11 +1,15 @@ package pro.tools.script; +import com.google.common.collect.Lists; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import pro.tools.path.ToolPath; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; +import java.io.IOException; +import java.nio.file.Paths; import java.util.Map; /** @@ -83,7 +87,11 @@ public static String render(String templateContent, Map paramMap */ public static void makeHtml(String tlPath, Map paramMap, String htmlPath) throws ScriptException { String html = render(tlPath, paramMap); - //ToolDirFile.createFile(htmlPath, html); + try { + ToolPath.writeStrings(Paths.get(htmlPath), Lists.newArrayList(html), false); + } catch (IOException e) { + e.printStackTrace(); + } } } From d04e0320523afddc733b98936f8722ada8144d21 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 21:08:45 +0800 Subject: [PATCH 27/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0gitignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 26498aa..143ba4a 100644 --- a/.gitignore +++ b/.gitignore @@ -41,5 +41,4 @@ hs_err_pid* .idea/ target/ *.iml -logs/ -.gitignore \ No newline at end of file +logs/ \ No newline at end of file From 253c5c8713deba64a83b16915f07a3bb5fc3aaf7 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 21:18:56 +0800 Subject: [PATCH 28/69] =?UTF-8?q?1=20=E5=A2=9E=E6=B7=BBLicense=E5=92=8CJDK?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84README=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 66d5c2c..6312bb8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # protools [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) +[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![JDK 1.8](https://img.shields.io/badge/JDK-1.7-green.svg "JDK 1.8")]() 历经开发周期两年,并且应用过千万级别项目的工具箱 From 4505a641942f7e4e44a550ef2f59c74ba6b4fa7a Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 21:20:08 +0800 Subject: [PATCH 29/69] =?UTF-8?q?1=20=E5=A2=9E=E6=B7=BBLicense=E5=92=8CJDK?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84README=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6312bb8..7714fde 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) -[![JDK 1.8](https://img.shields.io/badge/JDK-1.7-green.svg "JDK 1.8")]() +[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg "JDK 1.8")]() 历经开发周期两年,并且应用过千万级别项目的工具箱 From fd2ab2c471d809e75520b544326e2710fe02a932 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 21:21:18 +0800 Subject: [PATCH 30/69] =?UTF-8?q?1=20=E5=A2=9E=E6=B7=BBLicense=E5=92=8CJDK?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84README=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7714fde..af8dd95 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) -[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg "JDK 1.8")]() +[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg "jdk 1.8")]() 历经开发周期两年,并且应用过千万级别项目的工具箱 From c032b75f701bb0d94c1a15f63bc6875f64d0ae7e Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 21:21:42 +0800 Subject: [PATCH 31/69] =?UTF-8?q?1=20=E5=A2=9E=E6=B7=BBLicense=E5=92=8CJDK?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=9A=84README=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af8dd95..fb6707e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) [![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) -[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg "jdk 1.8")]() +[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)]() 历经开发周期两年,并且应用过千万级别项目的工具箱 From 66c7ee65aa1bc3ff6d55626880006e409f713597 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 21:24:20 +0800 Subject: [PATCH 32/69] =?UTF-8?q?1=20=E8=B7=9F=E8=BF=9B=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=202=20=E4=BF=AE=E6=94=B9README=E4=B8=AD?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E9=93=BE=E6=8E=A5=E7=9A=84=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 0307c16..ce3f3d8 100644 --- a/LICENSE +++ b/LICENSE @@ -176,7 +176,7 @@ recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2017 SeanDragon + Copyright 2018 SeanDragon Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index fb6707e..40eba82 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # protools [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) -[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/SeanDragon/protools/blob/master/LICENSE) [![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)]() 历经开发周期两年,并且应用过千万级别项目的工具箱 From 2038e723fb5140023367f8551741467c1764f72a Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 22:42:24 +0800 Subject: [PATCH 33/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 40eba82..de1786d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) [![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/SeanDragon/protools/blob/master/LICENSE) -[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)]() +[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)] 历经开发周期两年,并且应用过千万级别项目的工具箱 From 5beb80f3839a74616d1168027413a3f1fd8d29d7 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 22:43:01 +0800 Subject: [PATCH 34/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de1786d..54de9c4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/SeanDragon/protools.svg?branch=master)](https://travis-ci.org/SeanDragon/protools) [![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/SeanDragon/protools/blob/master/LICENSE) -[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)] +[![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)](#protools) 历经开发周期两年,并且应用过千万级别项目的工具箱 From 800a227d37ef4de2007c33be0bbfa0a9cdba61a0 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 23:06:42 +0800 Subject: [PATCH 35/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 54de9c4..4b4768e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 +温馨提示: +该项目中一些方法是由于当时开发需要,临时添加的,所以命名上可能有所欠妥。 +我也会使用阿里的规范手册整理规范所有代码,这个需要逐步进行。 +大家有建议可以提issues,有fix的提交pr即可。 + ### 目录 - [protools](#protools) From dc09df4e38a0b540abdf4cdec872814c9c2802ac Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 17 Jan 2018 23:07:44 +0800 Subject: [PATCH 36/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4b4768e..1cd337e 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 -温馨提示: -该项目中一些方法是由于当时开发需要,临时添加的,所以命名上可能有所欠妥。 -我也会使用阿里的规范手册整理规范所有代码,这个需要逐步进行。 -大家有建议可以提issues,有fix的提交pr即可。 +### 温馨提示: +* 该项目中一些方法是由于当时开发需要,临时添加的,所以命名上可能有所欠妥。 +* 我也会使用阿里的规范手册整理规范所有代码,这个需要逐步进行。 +* 大家有建议可以提issues,有fix的提交pr即可。 ### 目录 From a00e2e561c19859b01891b75ba2f7553d441fe2a Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 24 Jan 2018 12:16:57 +0800 Subject: [PATCH 37/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1cd337e..edadc06 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,14 @@ 历经开发周期两年,并且应用过千万级别项目的工具箱 -暂时还未添加到maven中心仓库,这几天部门解散,本人正在找工作,中心仓库的事情后续会跟进 +我也吸收了[https://www.v2ex.com/t/423700]该贴中v友对我的建议和意见,项目和我都会变得更好,谢谢大家 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 -### 温馨提示: -* 该项目中一些方法是由于当时开发需要,临时添加的,所以命名上可能有所欠妥。 -* 我也会使用阿里的规范手册整理规范所有代码,这个需要逐步进行。 -* 大家有建议可以提issues,有fix的提交pr即可。 +### 开发计划 +- 使用阿里的规范手册整理规范所有代码 +- 将当时临时添加或欠缺考虑的命名或方法进行优化 +- 将maven私人仓库转移到中心仓库 ### 目录 From 5de9a34c0304aab4588bfbef0fca782da67937fc Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 24 Jan 2018 12:18:10 +0800 Subject: [PATCH 38/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index edadc06..be6da5d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ 历经开发周期两年,并且应用过千万级别项目的工具箱 -我也吸收了[https://www.v2ex.com/t/423700]该贴中v友对我的建议和意见,项目和我都会变得更好,谢谢大家 +我也吸收了[https://www.v2ex.com/t/423700](https://www.v2ex.com/t/423700)该贴中v友对我的建议和意见,项目和我都会变得更好,谢谢大家 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 From 75652f2e26784a1910ce874b4a948b3bd1a860a3 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Wed, 24 Jan 2018 12:19:17 +0800 Subject: [PATCH 39/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index be6da5d..be75783 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 -### 开发计划 +## 开发计划 - 使用阿里的规范手册整理规范所有代码 - 将当时临时添加或欠缺考虑的命名或方法进行优化 - 将maven私人仓库转移到中心仓库 -### 目录 +## 目录 - [protools](#protools) - [common](#common) @@ -24,20 +24,20 @@ - [security](#common) - [all](#all) -## common +### common * 数据的处理 * 文件的处理 * script 引擎的封装 * 系统方面查询的封装 * 日期对象的封装DatePlus * 数值对象的封装Decimal -## http +### http * 统一发送对象为HttpSend * 统一接收对象为HttpReceive * 三个版本的 http 客户端(Jdk、Netty 和 OkHttp) -## mail +### mail * 封装 JavaMail,并采用了队列等方法提高性能,并简化了发送过程 -## security +### security * 封装了 jdk 和 bouncycastle 中几十种常见加密方式 -## all +### all * 如果需要使用上述多个模块,可以导入all模块以使用所有模块 \ No newline at end of file From bc9cf9e97fe36f93d4e0f07e240acccff939df88 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 25 Jan 2018 17:31:13 +0800 Subject: [PATCH 40/69] =?UTF-8?q?=E7=AE=80=E5=8D=95=E8=BF=87=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E9=81=8D=E9=98=BF=E9=87=8C=E7=9A=84=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E6=89=8B=E5=86=8C=EF=BC=8C=E6=8A=8A=E4=B8=80=E4=BA=9B=E6=98=BE?= =?UTF-8?q?=E8=80=8C=E6=98=93=E8=A7=81=E7=9A=84=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BA=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++ .../java/pro/tools/constant/UnitConst.java | 12 +++++++ .../pro/tools/data/image/ToolBarCode.java | 11 +++---- .../tools/data/image/ToolImagePressText.java | 6 +--- .../java/pro/tools/data/text/ToolConvert.java | 4 ++- .../java/pro/tools/data/text/ToolRegex.java | 6 ++-- .../pro/tools/data/text/json/TypeBuilder.java | 3 ++ .../pro/tools/data/text/json/TypeToken.java | 2 +- .../text/json/exception/TypeException.java | 5 ++- ...cTypeAdapter.java => BaseTypeAdapter.java} | 27 ++++++++++++++-- .../typeadapter/BigDecimalTypeAdapter.java | 5 ++- .../json/typeadapter/DatePlusTypeAdapter.java | 2 +- .../json/typeadapter/DecimalTypeAdapter.java | 5 ++- .../typeadapter/LocalDateTimeTypeAdapter.java | 2 +- .../typeadapter/LocalDateTypeAdapter.java | 5 ++- .../main/java/pro/tools/file/FileType.java | 2 ++ .../java/pro/tools/file/ToolFileType.java | 25 ++------------- .../java/pro/tools/script/ToolScript.java | 1 - .../pro/tools/system/NamedThreadFactory.java | 3 ++ .../main/java/pro/tools/time/DateType.java | 23 ++++++++++++++ .../src/main/java/pro/tools/time/Lunar.java | 2 ++ .../src/main/java/pro/tools/time/Solar.java | 2 ++ .../netty/clientpool/DefaultClientPool.java | 24 -------------- .../handler/HttpClientChannelPoolHandler.java | 1 - .../http/netty/handler/HttpClientHandler.java | 1 - .../tools/http/pojo/HttpDefaultHeaders.java | 17 +++++----- .../java/pro/tools/http/pojo/HttpMethod.java | 30 ++++++++++++++++++ .../main/java/pro/tools/security/ToolAES.java | 2 ++ .../java/pro/tools/security/ToolBase64.java | 31 ++++++------------- .../pro/tools/security/ToolCertificate.java | 2 ++ .../pro/tools/security/ToolCertificate2.java | 2 ++ .../main/java/pro/tools/security/ToolDES.java | 15 +++++---- .../java/pro/tools/security/ToolDESede.java | 2 ++ .../main/java/pro/tools/security/ToolDH.java | 2 ++ .../main/java/pro/tools/security/ToolDSA.java | 2 ++ .../java/pro/tools/security/ToolECDSA.java | 2 ++ .../java/pro/tools/security/ToolElGamal.java | 2 ++ .../java/pro/tools/security/ToolHTTPS.java | 2 ++ .../java/pro/tools/security/ToolHTTPS2.java | 3 +- .../java/pro/tools/security/ToolIDEA.java | 2 ++ .../main/java/pro/tools/security/ToolPBE.java | 2 ++ .../java/pro/tools/security/ToolPBE2.java | 5 +-- .../java/pro/tools/security/ToolPbkdf2.java | 2 ++ .../pro/tools/security/md/ToolHmacRipeMD.java | 2 ++ .../java/pro/tools/security/md/ToolMAC.java | 5 ++- .../pro/tools/security/md/ToolMAC_BCP.java | 2 ++ .../java/pro/tools/security/md/ToolMD.java | 2 ++ .../java/pro/tools/security/md/ToolMD2.java | 2 ++ .../java/pro/tools/security/md/ToolMD4.java | 2 ++ .../java/pro/tools/security/md/ToolMD5.java | 2 ++ .../pro/tools/security/md/ToolRipeMD.java | 2 ++ .../java/pro/tools/security/md/ToolSHA1.java | 2 ++ .../java/pro/tools/security/md/ToolSHA2.java | 2 ++ 53 files changed, 210 insertions(+), 120 deletions(-) rename common/src/main/java/pro/tools/data/text/json/typeadapter/{ABasicTypeAdapter.java => BaseTypeAdapter.java} (81%) diff --git a/README.md b/README.md index be75783..392a44a 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 +## 更新日志 +- 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 + ## 开发计划 - 使用阿里的规范手册整理规范所有代码 - 将当时临时添加或欠缺考虑的命名或方法进行优化 diff --git a/common/src/main/java/pro/tools/constant/UnitConst.java b/common/src/main/java/pro/tools/constant/UnitConst.java index 9821498..1545759 100644 --- a/common/src/main/java/pro/tools/constant/UnitConst.java +++ b/common/src/main/java/pro/tools/constant/UnitConst.java @@ -50,9 +50,21 @@ private UnitConst() { //endregion public enum MemoryUnit { + /** + * 字节 + */ BYTE, + /** + * KB + */ KB, + /** + * MB = 1024 * KB + */ MB, + /** + * GB = 1024 * MB + */ GB } diff --git a/common/src/main/java/pro/tools/data/image/ToolBarCode.java b/common/src/main/java/pro/tools/data/image/ToolBarCode.java index 08783e5..1def91a 100644 --- a/common/src/main/java/pro/tools/data/image/ToolBarCode.java +++ b/common/src/main/java/pro/tools/data/image/ToolBarCode.java @@ -22,6 +22,7 @@ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.nio.file.Paths; import java.util.Hashtable; /** @@ -57,7 +58,7 @@ public static void encode(String content, int width, int height, String fileType hints.put(EncodeHintType.CHARACTER_SET, StrConst.DEFAULT_CHARSET_NAME); BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints); File file = new File(savePath); - MatrixToImageWriter.writeToFile(bitMatrix, fileType, file); + MatrixToImageWriter.writeToPath(bitMatrix, fileType, file.toPath()); } /** @@ -204,10 +205,8 @@ public static BitMatrix createQRCode(String content, int width, int height) { * * @throws IOException */ - @SuppressWarnings({"deprecation"}) - @Deprecated public static void writeToFile(BitMatrix matrix, String format, String imagePath, String logoPath) throws IOException { - MatrixToImageWriter.writeToFile(matrix, format, new File(imagePath), new MatrixToImageConfig()); + MatrixToImageWriter.writeToPath(matrix, format, Paths.get(imagePath), new MatrixToImageConfig()); // 添加logo图片, 此处一定需要重新进行读取,而不能直接使用二维码的BufferedImage 对象 BufferedImage img = ImageIO.read(new File(imagePath)); @@ -230,10 +229,8 @@ public static void writeToFile(BitMatrix matrix, String format, String imagePath * * @throws IOException */ - @SuppressWarnings({"deprecation"}) - @Deprecated public static void writeToFile(BitMatrix matrix, String format, String imagePath, String logoPath, MatrixToLogoImageConfig logoConfig) throws IOException { - MatrixToImageWriter.writeToFile(matrix, format, new File(imagePath), new MatrixToImageConfig()); + MatrixToImageWriter.writeToPath(matrix, format, Paths.get(imagePath), new MatrixToImageConfig()); // 添加logo图片, 此处一定需要重新进行读取,而不能直接使用二维码的BufferedImage 对象 BufferedImage img = ImageIO.read(new File(imagePath)); diff --git a/common/src/main/java/pro/tools/data/image/ToolImagePressText.java b/common/src/main/java/pro/tools/data/image/ToolImagePressText.java index 1064f84..34a290b 100644 --- a/common/src/main/java/pro/tools/data/image/ToolImagePressText.java +++ b/common/src/main/java/pro/tools/data/image/ToolImagePressText.java @@ -44,12 +44,8 @@ public static void pressImage(String pressImg, String targetImg, int x, int y) t int readHeight = read.getHeight(null); g.drawImage(read, width - readWidth - x, height - readHeight - y, readWidth, readHeight, null); g.dispose(); - //try (FileOutputStream out = new FileOutputStream(targetImg)) { - // JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); - // encoder.encode(image); - //} String formatName = targetImg.substring(targetImg.lastIndexOf(".") + 1); - ImageIO.write(image, /*"GIF"*/ formatName /* format desired */, new File(targetImg) /* target */); + ImageIO.write(image, formatName, new File(targetImg)); } /** diff --git a/common/src/main/java/pro/tools/data/text/ToolConvert.java b/common/src/main/java/pro/tools/data/text/ToolConvert.java index 9131493..d258f7a 100644 --- a/common/src/main/java/pro/tools/data/text/ToolConvert.java +++ b/common/src/main/java/pro/tools/data/text/ToolConvert.java @@ -329,9 +329,11 @@ public static byte[] bits2Bytes(String bits) { int byteLen = bits.length() / 8; // 不是8的倍数前面补0 if (lenMod != 0) { + StringBuilder bitsBuilder = new StringBuilder(bits); for (int i = lenMod; i < 8; i++) { - bits = "0" + bits; + bitsBuilder.insert(0, "0"); } + bits = bitsBuilder.toString(); byteLen++; } byte[] bytes = new byte[byteLen]; diff --git a/common/src/main/java/pro/tools/data/text/ToolRegex.java b/common/src/main/java/pro/tools/data/text/ToolRegex.java index 2a0cc79..93f2966 100644 --- a/common/src/main/java/pro/tools/data/text/ToolRegex.java +++ b/common/src/main/java/pro/tools/data/text/ToolRegex.java @@ -41,7 +41,7 @@ private ToolRegex() { * @return 是返回true, 否则返回false */ public static boolean isInteger(CharSequence input) { - return NumberBo(0, input); + return isNumber(0, input); } /** @@ -53,7 +53,7 @@ public static boolean isInteger(CharSequence input) { * @return 是返回true, 否则返回false */ public static boolean isDecimal(CharSequence input) { - return NumberBo(1, input); + return isNumber(1, input); } @@ -67,7 +67,7 @@ public static boolean isDecimal(CharSequence input) { * * @return 是返回true, 否则返回false */ - private static boolean NumberBo(int type, CharSequence str) { + private static boolean isNumber(int type, CharSequence str) { if (ToolStr.isBlank(str.toString())) { return false; } diff --git a/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java b/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java index 76b9e2b..fc945fa 100644 --- a/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java +++ b/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java @@ -8,6 +8,9 @@ import java.lang.reflect.Type; import java.util.List; +/** + * @author SeanDragon + */ public class TypeBuilder { private final TypeBuilder parent; private final Class raw; diff --git a/common/src/main/java/pro/tools/data/text/json/TypeToken.java b/common/src/main/java/pro/tools/data/text/json/TypeToken.java index a004a33..48c034f 100644 --- a/common/src/main/java/pro/tools/data/text/json/TypeToken.java +++ b/common/src/main/java/pro/tools/data/text/json/TypeToken.java @@ -8,7 +8,7 @@ /** * @author SeanDragon */ -public abstract class TypeToken { +public final class TypeToken { private final Type type; public TypeToken() { diff --git a/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java b/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java index 6812225..fad2ec6 100644 --- a/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java +++ b/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java @@ -1,6 +1,9 @@ package pro.tools.data.text.json.exception; -public class TypeException extends RuntimeException { +/** + * @author SeanDragon + */ +public class TypeException extends Exception { public TypeException() { } diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/ABasicTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java similarity index 81% rename from common/src/main/java/pro/tools/data/text/json/typeadapter/ABasicTypeAdapter.java rename to common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java index 4ddd0d9..7cbd0bc 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/ABasicTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java @@ -7,8 +7,11 @@ import java.io.IOException; -public abstract class ABasicTypeAdapter extends TypeAdapter { - public ABasicTypeAdapter() { +/** + * @author SeanDragon + */ +public abstract class BaseTypeAdapter extends TypeAdapter { + BaseTypeAdapter() { } @Override @@ -25,8 +28,28 @@ public void write(JsonWriter jsonWriter, T value) throws IOException { } } + /** + * 读取值 + * + * @param jsonReader + * gson的阅读器 + * + * @return 返回值 + * + * @throws IOException + */ public abstract T reading(JsonReader jsonReader) throws IOException; + /** + * 赋值 + * + * @param jsonWriter + * gson的书写器 + * @param value + * 想要赋上的值 + * + * @throws IOException + */ public abstract void writing(JsonWriter jsonWriter, T value) throws IOException; protected boolean compareToken(JsonToken currentToken, JsonToken targetToken) { diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java index 3c8a766..2ec493b 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java @@ -6,7 +6,10 @@ import java.io.IOException; import java.math.BigDecimal; -public class BigDecimalTypeAdapter extends ABasicTypeAdapter { +/** + * @author SeanDragon + */ +public class BigDecimalTypeAdapter extends BaseTypeAdapter { @Override public BigDecimal reading(JsonReader jsonReader) throws IOException { diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java index 17c87e5..a2c638d 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java @@ -13,7 +13,7 @@ * * @author sd */ -public class DatePlusTypeAdapter extends ABasicTypeAdapter { +public class DatePlusTypeAdapter extends BaseTypeAdapter { private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss:SSS"); diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java index 26f47be..4aeb3a1 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java @@ -6,7 +6,10 @@ import java.io.IOException; -public class DecimalTypeAdapter extends ABasicTypeAdapter { +/** + * @author SeanDragon + */ +public class DecimalTypeAdapter extends BaseTypeAdapter { @Override public Decimal reading(JsonReader jsonReader) throws IOException { diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java index e909a55..59b5db3 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java @@ -11,7 +11,7 @@ /** * @author SeanDragon */ -public class LocalDateTimeTypeAdapter extends ABasicTypeAdapter { +public class LocalDateTimeTypeAdapter extends BaseTypeAdapter { private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss:SSS"); diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java index 4421fb8..cdcc7bc 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java @@ -8,7 +8,10 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; -public class LocalDateTypeAdapter extends ABasicTypeAdapter { +/** + * @author SeanDragon + */ +public class LocalDateTypeAdapter extends BaseTypeAdapter { public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); diff --git a/common/src/main/java/pro/tools/file/FileType.java b/common/src/main/java/pro/tools/file/FileType.java index 55a7bae..9768280 100644 --- a/common/src/main/java/pro/tools/file/FileType.java +++ b/common/src/main/java/pro/tools/file/FileType.java @@ -2,6 +2,8 @@ /** * 文件类型枚取 + * + * @author SeanDragon */ public enum FileType { diff --git a/common/src/main/java/pro/tools/file/ToolFileType.java b/common/src/main/java/pro/tools/file/ToolFileType.java index 5698520..b099eca 100644 --- a/common/src/main/java/pro/tools/file/ToolFileType.java +++ b/common/src/main/java/pro/tools/file/ToolFileType.java @@ -9,6 +9,8 @@ /** * 文件类型判断类 + * + * @author SeanDragon */ public final class ToolFileType { /** @@ -17,29 +19,6 @@ public final class ToolFileType { private ToolFileType() { } - ///** - // * 将文件头转换成16进制字符串 - // * - // * @param src - // * @return 16进制字符串 - // */ - //private static String bytesToHexString(byte[] src){ - // - // StringBuilder stringBuilder = new StringBuilder(); - // if (src == null || src.length <= 0) { - // return null; - // } - // for (byte aSrc : src) { - // int v = aSrc & 0xFF; - // String hv = Integer.toHexString(v); - // if (hv.length() < 2) { - // stringBuilder.append(0); - // } - // stringBuilder.append(hv); - // } - // return stringBuilder.toString(); - //} - /** * 得到文件头 * diff --git a/common/src/main/java/pro/tools/script/ToolScript.java b/common/src/main/java/pro/tools/script/ToolScript.java index 0c68054..3c286c2 100644 --- a/common/src/main/java/pro/tools/script/ToolScript.java +++ b/common/src/main/java/pro/tools/script/ToolScript.java @@ -71,7 +71,6 @@ public static String render(String templateContent, Map paramMap // } // 取js变量值 - return (String) engine.get("output"); } diff --git a/common/src/main/java/pro/tools/system/NamedThreadFactory.java b/common/src/main/java/pro/tools/system/NamedThreadFactory.java index 8827506..0a3390e 100644 --- a/common/src/main/java/pro/tools/system/NamedThreadFactory.java +++ b/common/src/main/java/pro/tools/system/NamedThreadFactory.java @@ -18,6 +18,9 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; +/** + * @author SeanDragon + */ public class NamedThreadFactory implements ThreadFactory { private static final AtomicInteger POOL_SEQ = new AtomicInteger(1); diff --git a/common/src/main/java/pro/tools/time/DateType.java b/common/src/main/java/pro/tools/time/DateType.java index 6edda79..9513e42 100644 --- a/common/src/main/java/pro/tools/time/DateType.java +++ b/common/src/main/java/pro/tools/time/DateType.java @@ -1,11 +1,34 @@ package pro.tools.time; +/** + * 日期类型 + * + * @author SeanDragon + */ public enum DateType { + /** + * 年 + */ YEAR(1), + /** + * 月 + */ MONTH(2), + /** + * 日 + */ DAY(3), + /** + * 时 + */ HOUR(4), + /** + * 分 + */ MINUTES(5), + /** + * 秒 + */ SECONDS(6); private int mean; diff --git a/common/src/main/java/pro/tools/time/Lunar.java b/common/src/main/java/pro/tools/time/Lunar.java index 2ba50f5..ef5f813 100644 --- a/common/src/main/java/pro/tools/time/Lunar.java +++ b/common/src/main/java/pro/tools/time/Lunar.java @@ -2,6 +2,8 @@ /** * 农历 + * + * @author SeanDragon */ public class Lunar { private boolean isLeap; diff --git a/common/src/main/java/pro/tools/time/Solar.java b/common/src/main/java/pro/tools/time/Solar.java index 50da436..e63d303 100644 --- a/common/src/main/java/pro/tools/time/Solar.java +++ b/common/src/main/java/pro/tools/time/Solar.java @@ -2,6 +2,8 @@ /** * 公历 + * + * @author SeanDragon */ public class Solar { private int solarYear; diff --git a/http/src/main/java/pro/tools/http/netty/clientpool/DefaultClientPool.java b/http/src/main/java/pro/tools/http/netty/clientpool/DefaultClientPool.java index 48ea810..f7cab54 100644 --- a/http/src/main/java/pro/tools/http/netty/clientpool/DefaultClientPool.java +++ b/http/src/main/java/pro/tools/http/netty/clientpool/DefaultClientPool.java @@ -122,7 +122,6 @@ public HttpReceive request(HttpSend httpSend, long timeout, TimeUnit timeUnit) { Future fch = channelPool.acquire(); Channel channel = null; try { - // final Channel channel = fch.syncUninterruptibly().getNow(); channel = fch.get(timeout, timeUnit); ChannelPipeline p = channel.pipeline(); @@ -200,16 +199,6 @@ private FullHttpRequest convertRequest(HttpSend httpSend) { content.deleteCharAt(content.length() - 1); } - // URI sendURI; - // try { - // sendURI = new URI(queryStringEncoder.toString()); - // } catch (URISyntaxException e) { - // if (log.isWarnEnabled()) { - // log.warn(e.getMessage(), e); - // } - // throw new RuntimeException(e); - // } - final FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1 , httpMethod , scheme + "://" + host + ":" + port + httpSend.getUrl() @@ -218,19 +207,6 @@ private FullHttpRequest convertRequest(HttpSend httpSend) { , Unpooled.copiedBuffer(content.toString().getBytes()) ); - // FIXME: 2017/7/27 暂未加Cookie - // if (cookies != null) { - // List cookieList = Lists.newArrayListWithCapacity(cookies.size()); - // cookies.forEach((key, value) -> { - // cookieList.add(new DefaultCookie(key, value)); - // }); - // - // request.headers().set( - // HttpHeaderNames.COOKIE, - // ClientCookieEncoder.STRICT.encode(cookieList) - // ); - // } - request.headers().add(DEFAULT_HTTP_HEADERS); if (headers != null) { headers.forEach((key, value) -> { diff --git a/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java b/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java index ab904a8..33d2672 100644 --- a/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java +++ b/http/src/main/java/pro/tools/http/netty/handler/HttpClientChannelPoolHandler.java @@ -28,7 +28,6 @@ public void channelCreated(Channel channel) { NioSocketChannel nioSocketChannel = (NioSocketChannel) channel; nioSocketChannel.config().setTcpNoDelay(true).setKeepAlive(true); - // final ChannelPipeline p = channel.pipeline(); final ChannelPipeline p = nioSocketChannel.pipeline(); //HTTPS diff --git a/http/src/main/java/pro/tools/http/netty/handler/HttpClientHandler.java b/http/src/main/java/pro/tools/http/netty/handler/HttpClientHandler.java index 9664371..da0fcb3 100644 --- a/http/src/main/java/pro/tools/http/netty/handler/HttpClientHandler.java +++ b/http/src/main/java/pro/tools/http/netty/handler/HttpClientHandler.java @@ -58,7 +58,6 @@ public void channelRead0(final ChannelHandlerContext ctx, final HttpObject msg) } else { if (log.isDebugEnabled()) { log.debug("#HTTP 内容开始{"); - // log.debug("}EOF#"); } } diff --git a/http/src/main/java/pro/tools/http/pojo/HttpDefaultHeaders.java b/http/src/main/java/pro/tools/http/pojo/HttpDefaultHeaders.java index 48212b2..830808e 100644 --- a/http/src/main/java/pro/tools/http/pojo/HttpDefaultHeaders.java +++ b/http/src/main/java/pro/tools/http/pojo/HttpDefaultHeaders.java @@ -10,23 +10,22 @@ * @author sd */ public class HttpDefaultHeaders { - private final static Map defaultHeaders; + private final static Map DEFAULT_HEADERS; static { - defaultHeaders = Maps.newHashMap(); + DEFAULT_HEADERS = Maps.newHashMap(); init(); } private static void init() { - defaultHeaders.put("connection", "keep-alive"); - defaultHeaders.put("accept-encoding", "gzip,deflate"); - // defaultHeaders.put("user-agent", "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)"); - defaultHeaders.put("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3191.0 Safari/537.36"); - defaultHeaders.put("DNT", 1); - defaultHeaders.put("cache-control", "max-age=0"); + DEFAULT_HEADERS.put("connection", "keep-alive"); + DEFAULT_HEADERS.put("accept-encoding", "gzip,deflate"); + DEFAULT_HEADERS.put("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3191.0 Safari/537.36"); + DEFAULT_HEADERS.put("DNT", 1); + DEFAULT_HEADERS.put("cache-control", "max-age=0"); } public static Map getDefaultHeaders() { - return defaultHeaders; + return DEFAULT_HEADERS; } } diff --git a/http/src/main/java/pro/tools/http/pojo/HttpMethod.java b/http/src/main/java/pro/tools/http/pojo/HttpMethod.java index 60c6c7c..a62983c 100644 --- a/http/src/main/java/pro/tools/http/pojo/HttpMethod.java +++ b/http/src/main/java/pro/tools/http/pojo/HttpMethod.java @@ -1,13 +1,43 @@ package pro.tools.http.pojo; +/** + * @author SeanDragon + */ public enum HttpMethod { + /** + * GET请求方式 + */ GET, + /** + * POST请求方式 + */ POST, + /** + * PUT请求方式 + */ PUT, + /** + * TRACE请求方式 + */ TRACE, + /** + * DELETE请求方式 + */ DELETE, + /** + * OPTIONS请求方式 + */ OPTIONS, + /** + * HEAD请求方式 + */ HEAD, + /** + * PATCH请求方式 + */ PATCH, + /** + * CONNECT请求方式 + */ CONNECT, } \ No newline at end of file diff --git a/security/src/main/java/pro/tools/security/ToolAES.java b/security/src/main/java/pro/tools/security/ToolAES.java index 2284d31..37b7837 100644 --- a/security/src/main/java/pro/tools/security/ToolAES.java +++ b/security/src/main/java/pro/tools/security/ToolAES.java @@ -26,6 +26,8 @@ * Jurisdiction Policy Files, 下载包的readme.txt * 有安装说明。就是替换${JAVA_HOME}/jre/lib/security/ * 下面的local_policy.jar和US_export_policy.jar + * + * @author SeanDragon */ public final class ToolAES { private ToolAES() { diff --git a/security/src/main/java/pro/tools/security/ToolBase64.java b/security/src/main/java/pro/tools/security/ToolBase64.java index 2864d65..171b04d 100644 --- a/security/src/main/java/pro/tools/security/ToolBase64.java +++ b/security/src/main/java/pro/tools/security/ToolBase64.java @@ -93,10 +93,6 @@ public static byte[] decode(char[] data) { --tempLen; // ignore non-valid chars and padding } } - // calculate required length: - // -- 3 bytes for every 4 valid base64 chars - // -- plus 2 bytes if there are 3 extra base64 chars, - // or plus 1 byte if there are 2 extra. int len = (tempLen / 4) * 3; if ((tempLen % 4) == 3) { @@ -108,27 +104,24 @@ public static byte[] decode(char[] data) { } byte[] out = new byte[len]; - int shift = 0; // # of excess bits stored in accum - int accum = 0; // excess bits + int shift = 0; + int accum = 0; int index = 0; - // we now go through the entire array (NOT using the 'tempLen' value) for (char aData : data) { int value = (aData > 255) ? -1 : codes[aData]; - if (value >= 0) { // skip over non-code - accum <<= 6; // bits shift up by 6 each time thru - shift += 6; // loop, with new bits being put in - accum |= value; // at the bottom. - if (shift >= 8) { // whenever there are 8 or more shifted in, - shift -= 8; // write them out (from the top, leaving any - out[index++] = // excess at the bottom for next iteration. - (byte) ((accum >> shift) & 0xff); + if (value >= 0) { + accum <<= 6; + shift += 6; + accum |= value; + if (shift >= 8) { + shift -= 8; + out[index++] = (byte) ((accum >> shift) & 0xff); } } } - // if there is STILL something wrong we just have to throw up now! if (index != out.length) { throw new Error("Miscalculated data length (wrote " + index + " instead of " + out.length + ")"); @@ -171,15 +164,9 @@ public static void decode(File file) throws IOException { } } - // - // code characters for values 0..63 - // private static char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" .toCharArray(); - // - // lookup table for converting base64 characters to value in range 0..63 - // private static byte[] codes = new byte[256]; static { diff --git a/security/src/main/java/pro/tools/security/ToolCertificate.java b/security/src/main/java/pro/tools/security/ToolCertificate.java index 775cf7f..0220050 100644 --- a/security/src/main/java/pro/tools/security/ToolCertificate.java +++ b/security/src/main/java/pro/tools/security/ToolCertificate.java @@ -22,6 +22,8 @@ /** * 证书组件 + * + * @author SeanDragon */ public final class ToolCertificate { private ToolCertificate() { diff --git a/security/src/main/java/pro/tools/security/ToolCertificate2.java b/security/src/main/java/pro/tools/security/ToolCertificate2.java index df4a45c..522039c 100644 --- a/security/src/main/java/pro/tools/security/ToolCertificate2.java +++ b/security/src/main/java/pro/tools/security/ToolCertificate2.java @@ -22,6 +22,8 @@ /** * 证书组件 + * + * @author SeanDragon */ public final class ToolCertificate2 { private ToolCertificate2() { diff --git a/security/src/main/java/pro/tools/security/ToolDES.java b/security/src/main/java/pro/tools/security/ToolDES.java index cbd5e9c..da64ab4 100644 --- a/security/src/main/java/pro/tools/security/ToolDES.java +++ b/security/src/main/java/pro/tools/security/ToolDES.java @@ -16,6 +16,8 @@ /** * DES安全编码组件 + * + * @author SeanDragon */ public final class ToolDES { @@ -125,16 +127,13 @@ public static byte[] encrypt(byte[] data, byte[] key) throws NoSuchAlgorithmExce public static byte[] initKey() throws NoSuchAlgorithmException { /* - * 实例化密钥生成器 - * - * 若要使用64bit密钥注意替换 将下述代码中的KeyGenerator.getInstance(CIPHER_ALGORITHM); - * 替换为KeyGenerator.getInstance(CIPHER_ALGORITHM, "BC"); - */ + 实例化密钥生成器 + 若要使用64bit密钥注意替换 将下述代码中的KeyGenerator.getInstance(CIPHER_ALGORITHM); + 替换为KeyGenerator.getInstance(CIPHER_ALGORITHM, "BC"); + */ KeyGenerator kg = KeyGenerator.getInstance(KEY_ALGORITHM); - /* - * 初始化密钥生成器 若要使用64bit密钥注意替换 将下述代码kg.init(56); 替换为kg.init(64); - */ + /*初始化密钥生成器 若要使用64bit密钥注意替换 将下述代码kg.init(56); 替换为kg.init(64);*/ kg.init(56, new SecureRandom()); // 生成秘密密钥 diff --git a/security/src/main/java/pro/tools/security/ToolDESede.java b/security/src/main/java/pro/tools/security/ToolDESede.java index f10692d..4a4dc02 100644 --- a/security/src/main/java/pro/tools/security/ToolDESede.java +++ b/security/src/main/java/pro/tools/security/ToolDESede.java @@ -15,6 +15,8 @@ /** * DESede安全编码组件 + * + * @author SeanDragon */ public final class ToolDESede { private ToolDESede() { diff --git a/security/src/main/java/pro/tools/security/ToolDH.java b/security/src/main/java/pro/tools/security/ToolDH.java index f9da31c..312be8e 100644 --- a/security/src/main/java/pro/tools/security/ToolDH.java +++ b/security/src/main/java/pro/tools/security/ToolDH.java @@ -28,6 +28,8 @@ /** * DH安全编码组件 + * + * @author SeanDragon */ public final class ToolDH { private ToolDH() { diff --git a/security/src/main/java/pro/tools/security/ToolDSA.java b/security/src/main/java/pro/tools/security/ToolDSA.java index 01aea10..0e0c18a 100644 --- a/security/src/main/java/pro/tools/security/ToolDSA.java +++ b/security/src/main/java/pro/tools/security/ToolDSA.java @@ -22,6 +22,8 @@ /** * DSA安全编码组件 + * + * @author SeanDragon */ public final class ToolDSA { private ToolDSA() { diff --git a/security/src/main/java/pro/tools/security/ToolECDSA.java b/security/src/main/java/pro/tools/security/ToolECDSA.java index 105a0de..6823087 100644 --- a/security/src/main/java/pro/tools/security/ToolECDSA.java +++ b/security/src/main/java/pro/tools/security/ToolECDSA.java @@ -30,6 +30,8 @@ /** * ECDSA安全编码组件 + * + * @author SeanDragon */ public final class ToolECDSA { private ToolECDSA() { diff --git a/security/src/main/java/pro/tools/security/ToolElGamal.java b/security/src/main/java/pro/tools/security/ToolElGamal.java index 97e1d46..3deed4b 100644 --- a/security/src/main/java/pro/tools/security/ToolElGamal.java +++ b/security/src/main/java/pro/tools/security/ToolElGamal.java @@ -29,6 +29,8 @@ /** * ElGamal安全编码组件 + * + * @author SeanDragon */ public final class ToolElGamal { private ToolElGamal() { diff --git a/security/src/main/java/pro/tools/security/ToolHTTPS.java b/security/src/main/java/pro/tools/security/ToolHTTPS.java index bcd8d78..37a6ba5 100644 --- a/security/src/main/java/pro/tools/security/ToolHTTPS.java +++ b/security/src/main/java/pro/tools/security/ToolHTTPS.java @@ -17,6 +17,8 @@ /** * HTTPS组件 + * + * @author SeanDragon */ public final class ToolHTTPS { private ToolHTTPS() { diff --git a/security/src/main/java/pro/tools/security/ToolHTTPS2.java b/security/src/main/java/pro/tools/security/ToolHTTPS2.java index 281d12f..ccae7bc 100644 --- a/security/src/main/java/pro/tools/security/ToolHTTPS2.java +++ b/security/src/main/java/pro/tools/security/ToolHTTPS2.java @@ -13,6 +13,8 @@ /** * HTTPS组件 + * + * @author SeanDragon */ public final class ToolHTTPS2 { private ToolHTTPS2() { @@ -35,7 +37,6 @@ private static KeyStore getKeyStore(String keyStorePath, String password) throws // 实例化密钥库 KeyStore ks = KeyStore.getInstance("PKCS12"); - // KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); // 获得密钥库文件流 FileInputStream is = new FileInputStream(keyStorePath); diff --git a/security/src/main/java/pro/tools/security/ToolIDEA.java b/security/src/main/java/pro/tools/security/ToolIDEA.java index 4f42733..92a8e4c 100644 --- a/security/src/main/java/pro/tools/security/ToolIDEA.java +++ b/security/src/main/java/pro/tools/security/ToolIDEA.java @@ -20,6 +20,8 @@ * IDEA安全编码组件 *

* 国际数据加密标准---IDEA:完全是新突破,几乎同时和AES出现 + * + * @author SeanDragon */ public final class ToolIDEA { private ToolIDEA() { diff --git a/security/src/main/java/pro/tools/security/ToolPBE.java b/security/src/main/java/pro/tools/security/ToolPBE.java index d133020..05989b7 100644 --- a/security/src/main/java/pro/tools/security/ToolPBE.java +++ b/security/src/main/java/pro/tools/security/ToolPBE.java @@ -20,6 +20,8 @@ *

* 基于口令的加密---PBE:前面的对称加密几乎如出一辙,流程基本一致,PBE综合了对称加密和消息摘要算法的优势,形成对称加密算法的一个特例。没有密钥的概念 * ,使用口令代替密钥 + * + * @author SeanDragon */ public final class ToolPBE { private ToolPBE() { diff --git a/security/src/main/java/pro/tools/security/ToolPBE2.java b/security/src/main/java/pro/tools/security/ToolPBE2.java index 9f5b054..4338070 100644 --- a/security/src/main/java/pro/tools/security/ToolPBE2.java +++ b/security/src/main/java/pro/tools/security/ToolPBE2.java @@ -120,9 +120,10 @@ private static String toHex(byte[] array) { BigInteger bi = new BigInteger(1, array); String hex = bi.toString(16); int paddingLength = (array.length * 2) - hex.length(); - if (paddingLength > 0) + if (paddingLength > 0) { return String.format("%0" + paddingLength + "d", 0) + hex; - else + } else { return hex; + } } } \ No newline at end of file diff --git a/security/src/main/java/pro/tools/security/ToolPbkdf2.java b/security/src/main/java/pro/tools/security/ToolPbkdf2.java index 0353499..f0a7cc1 100644 --- a/security/src/main/java/pro/tools/security/ToolPbkdf2.java +++ b/security/src/main/java/pro/tools/security/ToolPbkdf2.java @@ -20,6 +20,8 @@ * 2.当认证用户的时候,从数据库中取出盐和密文,将他们和明文密码同时传给authenticate(),根据返回结果判断是否认证成功。 *

* 3.当用户修改密码的时候,仍然可以使用原来的盐,只需要调用getEncryptedPassword()方法重新生成密文就可以了。 + * + * @author SeanDragon */ public final class ToolPbkdf2 { private ToolPbkdf2() { diff --git a/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java b/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java index d766f58..d403776 100644 --- a/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolHmacRipeMD.java @@ -14,6 +14,8 @@ /** * HmacRipeMD系列加密组件
* HmacRipeMD128、HmacRipeMD160共2种算法 + * + * @author SeanDragon */ public final class ToolHmacRipeMD { diff --git a/security/src/main/java/pro/tools/security/md/ToolMAC.java b/security/src/main/java/pro/tools/security/md/ToolMAC.java index 5f960fd..d288bca 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMAC.java +++ b/security/src/main/java/pro/tools/security/md/ToolMAC.java @@ -10,6 +10,8 @@ /** * MAC加密组件 + * + * @author SeanDragon */ public final class ToolMAC { @@ -109,9 +111,6 @@ public static byte[] encodeHmacSHA(byte[] data, byte[] key) throws NoSuchAlgorit return mac.doFinal(data); } -// // 根据所安装的 JCE 仲裁策略文件,返回指定转换的最大密钥长度。 -// public final static int getMaxAllowedKeyLength(String transformation) - /** * 初始化HmacSHA256密钥 * diff --git a/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java b/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java index a29213b..3579d74 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java +++ b/security/src/main/java/pro/tools/security/md/ToolMAC_BCP.java @@ -13,6 +13,8 @@ /** * MAC消息摘要组件 + * + * @author SeanDragon */ public final class ToolMAC_BCP { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD.java b/security/src/main/java/pro/tools/security/md/ToolMD.java index e5ec6fe..f154dd6 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD.java @@ -10,6 +10,8 @@ /** * MD系列加密组件
* Tiger、Whirlpool和GOST3411共3种算法 + * + * @author SeanDragon */ public final class ToolMD { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD2.java b/security/src/main/java/pro/tools/security/md/ToolMD2.java index d4dc015..742bbe3 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD2.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD2.java @@ -7,6 +7,8 @@ /** * MD加密组件 + * + * @author SeanDragon */ public final class ToolMD2 { private ToolMD2() { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD4.java b/security/src/main/java/pro/tools/security/md/ToolMD4.java index 9ab0b57..f538c6d 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD4.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD4.java @@ -9,6 +9,8 @@ /** * MD4加密组件 + * + * @author SeanDragon */ public final class ToolMD4 { private ToolMD4() { diff --git a/security/src/main/java/pro/tools/security/md/ToolMD5.java b/security/src/main/java/pro/tools/security/md/ToolMD5.java index 0e1f6bb..9718689 100644 --- a/security/src/main/java/pro/tools/security/md/ToolMD5.java +++ b/security/src/main/java/pro/tools/security/md/ToolMD5.java @@ -9,6 +9,8 @@ /** * MD5加密组件 + * + * @author SeanDragon */ public final class ToolMD5 { private ToolMD5() { diff --git a/security/src/main/java/pro/tools/security/md/ToolRipeMD.java b/security/src/main/java/pro/tools/security/md/ToolRipeMD.java index a9b233b..57f31ea 100644 --- a/security/src/main/java/pro/tools/security/md/ToolRipeMD.java +++ b/security/src/main/java/pro/tools/security/md/ToolRipeMD.java @@ -10,6 +10,8 @@ /** * RipeMD系列消息摘要组件
* 包含RipeMD128、RipeMD160、RipeMD256和RipeMD320共4种RipeMD系列算法 + * + * @author SeanDragon */ public final class ToolRipeMD { private ToolRipeMD() { diff --git a/security/src/main/java/pro/tools/security/md/ToolSHA1.java b/security/src/main/java/pro/tools/security/md/ToolSHA1.java index d48b50b..7a8479b 100644 --- a/security/src/main/java/pro/tools/security/md/ToolSHA1.java +++ b/security/src/main/java/pro/tools/security/md/ToolSHA1.java @@ -7,6 +7,8 @@ /** * SHA-1加密 + * + * @author SeanDragon */ public final class ToolSHA1 { private ToolSHA1() { diff --git a/security/src/main/java/pro/tools/security/md/ToolSHA2.java b/security/src/main/java/pro/tools/security/md/ToolSHA2.java index 17df751..ce530ad 100644 --- a/security/src/main/java/pro/tools/security/md/ToolSHA2.java +++ b/security/src/main/java/pro/tools/security/md/ToolSHA2.java @@ -9,6 +9,8 @@ /** * SHA-2 的变种 SHA- 224、 SHA- 256、 SHA-384 、 SHA-512 + * + * @author SeanDragon */ public final class ToolSHA2 { private ToolSHA2() { From f740ddb9f04a5b88577c6a76e587d43d70d1c635 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 25 Jan 2018 17:34:43 +0800 Subject: [PATCH 41/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- changlog.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changlog.txt diff --git a/README.md b/README.md index 392a44a..4200c3b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 -## 更新日志 +## [更新日志](https://github.com/SeanDragon/protools/blob/master/changelog.txt) - 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 ## 开发计划 diff --git a/changlog.txt b/changlog.txt new file mode 100644 index 0000000..343d373 --- /dev/null +++ b/changlog.txt @@ -0,0 +1,2 @@ +2018-01-25 17:31 + 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 \ No newline at end of file From 3be54b718697c090afaa38283229c0936db2160c Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 25 Jan 2018 17:34:59 +0800 Subject: [PATCH 42/69] =?UTF-8?q?1=20=E6=9B=B4=E6=96=B0README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changlog.txt => changelog.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename changlog.txt => changelog.txt (100%) diff --git a/changlog.txt b/changelog.txt similarity index 100% rename from changlog.txt rename to changelog.txt From 56aff29b8453315047e11fdb73601bfaa51b6849 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 25 Jan 2018 17:58:37 +0800 Subject: [PATCH 43/69] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=A7=81=E5=BA=93?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8C=85=EF=BC=8C=E6=9B=BF=E6=8D=A2=E4=B8=BA?= =?UTF-8?q?=E5=AE=98=E6=96=B9=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + changelog.txt | 5 +++-- common/pom.xml | 4 ++-- common/src/main/java/pro/tools/data/text/ToolJson.java | 8 ++++---- .../java/pro/tools/data/text/json/TypeBuilder.java | 2 +- .../tools/data/text/json/exception/TypeException.java | 2 +- .../data/text/json/typeadapter/BaseTypeAdapter.java | 8 ++++---- .../text/json/typeadapter/BigDecimalTypeAdapter.java | 4 ++-- .../text/json/typeadapter/DatePlusTypeAdapter.java | 4 ++-- .../data/text/json/typeadapter/DecimalTypeAdapter.java | 4 ++-- .../json/typeadapter/LocalDateTimeTypeAdapter.java | 4 ++-- .../text/json/typeadapter/LocalDateTypeAdapter.java | 4 ++-- .../data/text/json/typeadapter/TreeMapTypeAdapter.java | 10 +++++----- pom.xml | 8 -------- 14 files changed, 31 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 4200c3b..745628f 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ ## [更新日志](https://github.com/SeanDragon/protools/blob/master/changelog.txt) - 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 +- 去除私库中的包,替换为官方包。 ## 开发计划 - 使用阿里的规范手册整理规范所有代码 diff --git a/changelog.txt b/changelog.txt index 343d373..e4af990 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,2 +1,3 @@ -2018-01-25 17:31 - 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 \ No newline at end of file +2018-01-25 + 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 + 去除私库中的包,替换为官方包 \ No newline at end of file diff --git a/common/pom.xml b/common/pom.xml index a7ada1a..93068a6 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -28,9 +28,9 @@ - org.google.code.gson + com.google.code.gson gson - 2.8.3 + 2.8.2 diff --git a/common/src/main/java/pro/tools/data/text/ToolJson.java b/common/src/main/java/pro/tools/data/text/ToolJson.java index c665805..c9acdbe 100644 --- a/common/src/main/java/pro/tools/data/text/ToolJson.java +++ b/common/src/main/java/pro/tools/data/text/ToolJson.java @@ -2,10 +2,10 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import org.google.gson.Gson; -import org.google.gson.GsonBuilder; -import org.google.gson.JsonObject; -import org.google.gson.reflect.TypeToken; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.reflect.TypeToken; import pro.tools.data.decimal.Decimal; import pro.tools.data.text.json.TypeBuilder; import pro.tools.data.text.json.typeadapter.BigDecimalTypeAdapter; diff --git a/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java b/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java index fc945fa..74f434d 100644 --- a/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java +++ b/common/src/main/java/pro/tools/data/text/json/TypeBuilder.java @@ -36,7 +36,7 @@ public TypeBuilder beginSubType(Class raw) { return newInstance(raw, this); } - public TypeBuilder endSubType() { + public TypeBuilder endSubType() throws TypeException { if (parent == null) { throw new TypeException("expect beginSubType() before endSubType()"); } diff --git a/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java b/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java index fad2ec6..05a3721 100644 --- a/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java +++ b/common/src/main/java/pro/tools/data/text/json/exception/TypeException.java @@ -3,7 +3,7 @@ /** * @author SeanDragon */ -public class TypeException extends Exception { +public class TypeException extends RuntimeException { public TypeException() { } diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java index 7cbd0bc..e5938eb 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/BaseTypeAdapter.java @@ -1,9 +1,9 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.TypeAdapter; -import org.google.gson.stream.JsonReader; -import org.google.gson.stream.JsonToken; -import org.google.gson.stream.JsonWriter; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonToken; +import com.google.gson.stream.JsonWriter; import java.io.IOException; diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java index 2ec493b..8245abe 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/BigDecimalTypeAdapter.java @@ -1,7 +1,7 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.stream.JsonReader; -import org.google.gson.stream.JsonWriter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.math.BigDecimal; diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java index a2c638d..5c7200b 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/DatePlusTypeAdapter.java @@ -1,7 +1,7 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.stream.JsonReader; -import org.google.gson.stream.JsonWriter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import pro.tools.time.DatePlus; import pro.tools.time.ToolDatePlus; diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java index 4aeb3a1..46cad33 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/DecimalTypeAdapter.java @@ -1,7 +1,7 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.stream.JsonReader; -import org.google.gson.stream.JsonWriter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import pro.tools.data.decimal.Decimal; import java.io.IOException; diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java index 59b5db3..89b9627 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTimeTypeAdapter.java @@ -1,7 +1,7 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.stream.JsonReader; -import org.google.gson.stream.JsonWriter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.sql.Timestamp; diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java index cdcc7bc..fde79e2 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/LocalDateTypeAdapter.java @@ -1,7 +1,7 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.stream.JsonReader; -import org.google.gson.stream.JsonWriter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.sql.Date; diff --git a/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java b/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java index 3ef0c0d..de305a1 100644 --- a/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java +++ b/common/src/main/java/pro/tools/data/text/json/typeadapter/TreeMapTypeAdapter.java @@ -1,10 +1,10 @@ package pro.tools.data.text.json.typeadapter; -import org.google.gson.JsonDeserializationContext; -import org.google.gson.JsonDeserializer; -import org.google.gson.JsonElement; -import org.google.gson.JsonParseException; -import org.google.gson.JsonPrimitive; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.JsonPrimitive; import java.lang.reflect.Type; import java.util.TreeMap; diff --git a/pom.xml b/pom.xml index c2de16d..b7ea04c 100644 --- a/pom.xml +++ b/pom.xml @@ -94,12 +94,4 @@ - - - our - Nexus Repository - http://maven.asyou.cc:8081/repository/maven-public/ - - - \ No newline at end of file From 09c495476d3b12c4dd9d1177b0c82b1b4f721264 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 25 Jan 2018 21:25:41 +0800 Subject: [PATCH 44/69] =?UTF-8?q?=E6=B7=BB=E5=8A=A0pom=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E9=A1=B9=E7=9B=AE=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index b7ea04c..2de20c7 100644 --- a/pom.xml +++ b/pom.xml @@ -8,6 +8,10 @@ pro.tools protools 3.0 + protools + 历经开发周期两年,并且应用过千万级别项目的工具箱 + https://github.com/SeanDragon/protools + common mail From 9837a328aee0fcf2a4211992569a5a1a8e9820cf Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Sun, 1 Apr 2018 15:58:48 +0800 Subject: [PATCH 45/69] =?UTF-8?q?1=20DatePlus=E4=B8=AD=E7=9A=84=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E7=9A=84=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/main/java/pro/tools/data/decimal/Decimal.java | 3 ++- common/src/main/java/pro/tools/time/DatePlus.java | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/pro/tools/data/decimal/Decimal.java b/common/src/main/java/pro/tools/data/decimal/Decimal.java index df77c2f..b28337c 100644 --- a/common/src/main/java/pro/tools/data/decimal/Decimal.java +++ b/common/src/main/java/pro/tools/data/decimal/Decimal.java @@ -12,7 +12,8 @@ /** * 数值类型封装类 * - * @author SeanDragon Create By 2017-04-13 14:22 + * @author SeanDragon + * Create By 2017-04-13 14:22 */ public class Decimal extends Number implements Cloneable { diff --git a/common/src/main/java/pro/tools/time/DatePlus.java b/common/src/main/java/pro/tools/time/DatePlus.java index a2599e6..5a8eb1a 100644 --- a/common/src/main/java/pro/tools/time/DatePlus.java +++ b/common/src/main/java/pro/tools/time/DatePlus.java @@ -10,6 +10,7 @@ import java.time.format.DateTimeParseException; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAdjusters; +import java.util.Date; /** * Created on 17/4/8 19:27 星期六. 替代时间类的类 @@ -243,7 +244,7 @@ public DatePlus getLastDayOfYear() { } /** - * 获取这个月的最后一天 + * 获取这个月的第一天 * * @return 天 */ @@ -261,7 +262,7 @@ public DatePlus getFirstDayOfYear() { } /** - * 获取这个月的最后一天 + * 获取下个月的第一天 * * @return 天 */ @@ -469,7 +470,7 @@ public DatePlus toMaxDate(DateType dateType) { return this; } - public java.util.Date toDate() { + public Date toDate() { return ToolDatePlus.localDateTime2Date(this.localDateTime); } From 9f2f5fd1ace3a6809977ebba11b1fd1d20d2914a Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Fri, 4 May 2018 14:56:52 +0800 Subject: [PATCH 46/69] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=BE=E5=BE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SeanDragon --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 745628f..42128dd 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ [![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/SeanDragon/protools/blob/master/LICENSE) [![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)](#protools) +[![GitHub stars](https://img.shields.io/github/stars/SeanDragon/protools.svg?style=flat&label=Star)](https://github.com/SeanDragon/protools/stargazers) +[![GitHub forks](https://img.shields.io/github/forks/SeanDragon/protools.svg?style=flat&label=Fork)](https://github.com/SeanDragon/protools/fork) +[![GitHub watchers](https://img.shields.io/github/watchers/SeanDragon/protools.svg?style=flat&label=Watch)](https://github.com/SeanDragon/protools/watchers) + 历经开发周期两年,并且应用过千万级别项目的工具箱 我也吸收了[https://www.v2ex.com/t/423700](https://www.v2ex.com/t/423700)该贴中v友对我的建议和意见,项目和我都会变得更好,谢谢大家 From ad26ed87c688658a77678dbeed6c1ce39bdc5d8a Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Fri, 4 May 2018 14:58:11 +0800 Subject: [PATCH 47/69] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SeanDragon --- README.md | 4 ---- changelog.txt | 3 --- 2 files changed, 7 deletions(-) delete mode 100644 changelog.txt diff --git a/README.md b/README.md index 42128dd..d0b4d98 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,6 @@ 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 -## [更新日志](https://github.com/SeanDragon/protools/blob/master/changelog.txt) -- 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 -- 去除私库中的包,替换为官方包。 - ## 开发计划 - 使用阿里的规范手册整理规范所有代码 - 将当时临时添加或欠缺考虑的命名或方法进行优化 diff --git a/changelog.txt b/changelog.txt deleted file mode 100644 index e4af990..0000000 --- a/changelog.txt +++ /dev/null @@ -1,3 +0,0 @@ -2018-01-25 - 简单过了一遍阿里的规范手册,把一些显而易见的代码优化了。 - 去除私库中的包,替换为官方包 \ No newline at end of file From b008ee4f4efc3c6bfa02fadcc3c6c89e8b7fb1ca Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Fri, 4 May 2018 15:46:01 +0800 Subject: [PATCH 48/69] =?UTF-8?q?1=20=E5=B0=86=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=E6=8F=90=E5=8F=96=E5=88=B0=E5=B1=9E=E6=80=A7=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E4=B8=AD=202=20=E4=B8=BA=E6=B7=BB=E5=8A=A0=E5=88=B0maven?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E5=81=9A=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SeanDragon --- all/pom.xml | 12 ++++++---- common/pom.xml | 27 ++++++++++++++------- http/pom.xml | 17 ++++++++----- mail/pom.xml | 8 +++++-- pom.xml | 62 ++++++++++++++++++++++++++++++++++++++---------- security/pom.xml | 10 +++++--- 6 files changed, 101 insertions(+), 35 deletions(-) diff --git a/all/pom.xml b/all/pom.xml index cadfcbe..4cf618d 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -17,28 +17,32 @@ pro.tools http - 3.0 + ${project.version} pro.tools mail - 3.0 + ${project.version} pro.tools security - 3.0 + ${project.version} + + 1.4 + + org.apache.maven.plugins maven-shade-plugin - 1.4 + ${shade-plugin.version} package diff --git a/common/pom.xml b/common/pom.xml index 93068a6..6b7f507 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -16,49 +16,49 @@ org.slf4j slf4j-api - 1.7.9 + ${slf4j.version} com.google.guava guava - 23.5-jre + ${guavav.version} com.google.code.gson gson - 2.8.2 + ${gson.version} com.google.zxing javase - 3.3.1 + ${zxing.version} com.belerweb pinyin4j - 2.5.1 + ${pinyin4j.version} uk.com.robust-it cloning - 1.9.6 + ${cloning.version} de.ruedigermoeller fst - 2.56 + ${fst.version} objenesis @@ -71,7 +71,7 @@ com.github.junrar junrar - 0.7 + ${junrar.version} maven-scm-api @@ -89,4 +89,15 @@ + + 1.0.0 + 2.56 + 1.9.6 + 2.5.1 + 3.3.1 + 2.8.2 + 23.5-jre + 1.7.9 + + \ No newline at end of file diff --git a/http/pom.xml b/http/pom.xml index 7270932..4a51313 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -15,24 +15,24 @@ pro.tools common - 3.0 + ${project.version} io.netty netty-handler - 4.1.17.Final + ${netty.version} io.netty netty-codec-http - 4.1.17.Final + ${netty.version} com.ning async-http-client - 1.9.40 + ${com.ning.version} netty @@ -48,9 +48,14 @@ com.squareup.okhttp3 okhttp - 3.9.0 + ${okhttp.version} - + + 4.1.17.Final + 1.9.40 + 3.9.0 + + \ No newline at end of file diff --git a/mail/pom.xml b/mail/pom.xml index 5b510bb..692aab7 100644 --- a/mail/pom.xml +++ b/mail/pom.xml @@ -15,15 +15,19 @@ pro.tools common - 3.0 + ${project.version} com.sun.mail javax.mail - 1.6.0 + ${mail.version} + + 1.6.0 + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2de20c7..2402711 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ junit junit - 4.12 + ${junit.version} test @@ -44,13 +44,21 @@ Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt + https://raw.githubusercontent.com/SeanDragon/protools/master/LICENSE repo - + UTF-8 + 1.8 + 1.8 + + 4.12 + + 3.6.1 + 3.0.1 + 2.20 @@ -60,22 +68,21 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + ${compile-plugin.version} - 1.8 - 1.8 - UTF-8 + ${maven.compiler.source} + ${maven.compiler.target} + ${project.build.sourceEncoding} true org.apache.maven.plugins maven-source-plugin - 3.0.1 + ${source-plugin.version} attach-sources - verify jar @@ -85,17 +92,48 @@ org.apache.maven.plugins maven-surefire-plugin - 2.20 + ${surefire-plugin.version} true once - -Dfile.encoding=UTF-8 + -Dfile.encoding=${project.build.sourceEncoding} maven-dependency-plugin + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://oss.sonatype.org/ + true + + - \ No newline at end of file + + + scm:git:git@github.com:SeanDragon/protools.git + scm:git:git@github.com:SeanDragon/protools.git + git@github.com:SeanDragon/protools.git + v${project.version} + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + Maven Central Staging Repository + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + diff --git a/security/pom.xml b/security/pom.xml index 1560454..9d59da3 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -15,19 +15,23 @@ pro.tools common - 3.0 + ${project.version} org.bouncycastle bcprov-jdk15on - 1.58 + ${jdk15on.version} org.bouncycastle bcprov-ext-jdk15on - 1.58 + ${jdk15on.version} + + + 1.58 + \ No newline at end of file From 2ae1f34bfd95075f43319ed70505fcc9caafa29b Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Fri, 4 May 2018 19:50:57 +0800 Subject: [PATCH 49/69] Star OverTime Signed-off-by: SeanDragon --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d0b4d98..4036fc6 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ [![GitHub forks](https://img.shields.io/github/forks/SeanDragon/protools.svg?style=flat&label=Fork)](https://github.com/SeanDragon/protools/fork) [![GitHub watchers](https://img.shields.io/github/watchers/SeanDragon/protools.svg?style=flat&label=Watch)](https://github.com/SeanDragon/protools/watchers) +[![Stargazers over time](https://starcharts.herokuapp.com/SeanDragon/protools.svg)](https://starcharts.herokuapp.com/SeanDragon/protools) + 历经开发周期两年,并且应用过千万级别项目的工具箱 我也吸收了[https://www.v2ex.com/t/423700](https://www.v2ex.com/t/423700)该贴中v友对我的建议和意见,项目和我都会变得更好,谢谢大家 From bddc52122fc4f629d1b00ee403803e1ec136d83d Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 2 Aug 2018 17:10:29 +0800 Subject: [PATCH 50/69] =?UTF-8?q?1=20=E4=B8=8A=E4=BC=A0=E5=9B=BD=E5=AF=86?= =?UTF-8?q?=E7=AE=97=E6=B3=95=E4=B8=AD=E7=9A=84SM2=20SM3=202=20=E9=87=8D?= =?UTF-8?q?=E5=86=99ToolBarCode=EF=BC=8C=E5=8A=A0=E5=BC=BA=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E7=94=9F=E6=88=90=E6=96=B9=E5=BC=8F=EF=BC=8C?= =?UTF-8?q?=E6=B1=89=E5=AD=97=E6=94=AF=E6=8C=81=E5=88=B0635=E4=B8=AA?= =?UTF-8?q?=EF=BC=8C=E5=AD=97=E6=AF=8D=E6=95=B0=E5=AD=97=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=88=B02785=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: SeanDragon --- .../pro/tools/data/image/ToolBarCode.java | 132 ++-- .../pro/tools/data/text/ToolStrCompress.java | 96 +++ .../main/java/pro/tools/security/sm/SM2.java | 712 ++++++++++++++++++ .../pro/tools/security/sm/SM2KeyPair.java | 30 + .../main/java/pro/tools/security/sm/SM3.java | 206 +++++ 5 files changed, 1093 insertions(+), 83 deletions(-) create mode 100644 common/src/main/java/pro/tools/data/text/ToolStrCompress.java create mode 100644 security/src/main/java/pro/tools/security/sm/SM2.java create mode 100644 security/src/main/java/pro/tools/security/sm/SM2KeyPair.java create mode 100644 security/src/main/java/pro/tools/security/sm/SM3.java diff --git a/common/src/main/java/pro/tools/data/image/ToolBarCode.java b/common/src/main/java/pro/tools/data/image/ToolBarCode.java index 1def91a..19ee9e3 100644 --- a/common/src/main/java/pro/tools/data/image/ToolBarCode.java +++ b/common/src/main/java/pro/tools/data/image/ToolBarCode.java @@ -1,19 +1,12 @@ package pro.tools.data.image; -import com.google.zxing.BarcodeFormat; -import com.google.zxing.BinaryBitmap; -import com.google.zxing.EncodeHintType; -import com.google.zxing.LuminanceSource; -import com.google.zxing.MultiFormatReader; -import com.google.zxing.MultiFormatWriter; -import com.google.zxing.NotFoundException; -import com.google.zxing.Result; -import com.google.zxing.WriterException; +import com.google.zxing.*; import com.google.zxing.client.j2se.BufferedImageLuminanceSource; import com.google.zxing.client.j2se.MatrixToImageConfig; import com.google.zxing.client.j2se.MatrixToImageWriter; import com.google.zxing.common.BitMatrix; import com.google.zxing.common.HybridBinarizer; +import com.google.zxing.qrcode.QRCodeWriter; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import pro.tools.constant.StrConst; @@ -22,9 +15,14 @@ import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetEncoder; import java.nio.file.Paths; import java.util.Hashtable; +import static com.google.zxing.BarcodeFormat.QR_CODE; + /** * 条码处理 * @@ -39,43 +37,36 @@ private ToolBarCode() { /** * 生成二维码 * - * @param content - * 条码文本内容 - * @param width - * 条码宽度 - * @param height - * 条码高度 - * @param fileType - * 文件类型,如png - * @param savePath - * 保存路径 + * @param content 条码文本内容 + * @param width 条码宽度 + * @param height 条码高度 + * @param fileType 文件类型,如png + * @param savePath 保存路径 */ @SuppressWarnings({"rawtypes", "unchecked", "deprecation"}) - @Deprecated public static void encode(String content, int width, int height, String fileType, String savePath) throws IOException, WriterException { - content = new String(content.getBytes(StrConst.DEFAULT_CHARSET_NAME), StrConst.DEFAULT_CHARSET_NAME);// 二维码内容 - Hashtable hints = new Hashtable(); - hints.put(EncodeHintType.CHARACTER_SET, StrConst.DEFAULT_CHARSET_NAME); - BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints); + Charset charset = Charset.forName("UTF-8"); + CharsetEncoder encoder = charset.newEncoder(); + + byte[] b = encoder.encode(CharBuffer.wrap(content)).array(); + String data = new String(b, "iso8859-1"); + + Writer writer = new QRCodeWriter(); + BitMatrix matrix = writer.encode(data, QR_CODE, width, height); File file = new File(savePath); - MatrixToImageWriter.writeToPath(bitMatrix, fileType, file.toPath()); + MatrixToImageWriter.writeToFile(matrix, fileType, file); } + /** * 生成带logo的二维码 * - * @param content - * 条码文本内容 - * @param width - * 条码宽度 - * @param height - * 条码高度 - * @param logoPath - * 条码中logo的路径 - * @param fileType - * 文件类型,如png - * @param savePath - * 保存路径 + * @param content 条码文本内容 + * @param width 条码宽度 + * @param height 条码高度 + * @param logoPath 条码中logo的路径 + * @param fileType 文件类型,如png + * @param savePath 保存路径 */ public static void encodeLogo(String content, int width, int height, String logoPath, String fileType, String savePath) throws IOException { BitMatrix matrix = MatrixToImageWriterEx.createQRCode(content, width, height); @@ -87,22 +78,16 @@ public static void encodeLogo(String content, int width, int height, String logo * 解码 * * @param filePath - * * @return */ @SuppressWarnings({"rawtypes", "unchecked"}) public static String decode(String filePath) throws IOException, NotFoundException { - BufferedImage image; - image = ImageIO.read(new File(filePath)); - if (image == null) { - return "Could not decode image"; - } + BufferedImage image = ImageIO.read(new File(filePath)); LuminanceSource source = new BufferedImageLuminanceSource(image); BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); - Result result; - Hashtable hints = new Hashtable(); - hints.put(EncodeHintType.CHARACTER_SET, StrConst.DEFAULT_CHARSET_NAME); - result = new MultiFormatReader().decode(bitmap, hints); + Hashtable hints = new Hashtable<>(); + hints.put(DecodeHintType.CHARACTER_SET, "UTF-8"); + Result result = new MultiFormatReader().decode(bitmap, hints); return result.getText(); } @@ -167,13 +152,9 @@ class MatrixToImageWriterEx { /** * 根据内容生成二维码数据 * - * @param content - * 二维码文字内容[为了信息安全性,一般都要先进行数据加密] - * @param width - * 二维码照片宽度 - * @param height - * 二维码照片高度 - * + * @param content 二维码文字内容[为了信息安全性,一般都要先进行数据加密] + * @param width 二维码照片宽度 + * @param height 二维码照片高度 * @return */ public static BitMatrix createQRCode(String content, int width, int height) { @@ -184,7 +165,7 @@ public static BitMatrix createQRCode(String content, int width, int height) { hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); BitMatrix matrix = null; try { - matrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, width, height, hints); + matrix = new MultiFormatWriter().encode(content, QR_CODE, width, height, hints); } catch (WriterException e) { e.printStackTrace(); } @@ -194,15 +175,10 @@ public static BitMatrix createQRCode(String content, int width, int height) { /** * 写入二维码、以及将照片logo写入二维码中 * - * @param matrix - * 要写入的二维码 - * @param format - * 二维码照片格式 - * @param imagePath - * 二维码照片保存路径 - * @param logoPath - * logo路径 - * + * @param matrix 要写入的二维码 + * @param format 二维码照片格式 + * @param imagePath 二维码照片保存路径 + * @param logoPath logo路径 * @throws IOException */ public static void writeToFile(BitMatrix matrix, String format, String imagePath, String logoPath) throws IOException { @@ -216,17 +192,11 @@ public static void writeToFile(BitMatrix matrix, String format, String imagePath /** * 写入二维码、以及将照片logo写入二维码中 * - * @param matrix - * 要写入的二维码 - * @param format - * 二维码照片格式 - * @param imagePath - * 二维码照片保存路径 - * @param logoPath - * logo路径 - * @param logoConfig - * logo配置对象 - * + * @param matrix 要写入的二维码 + * @param format 二维码照片格式 + * @param imagePath 二维码照片保存路径 + * @param logoPath logo路径 + * @param logoConfig logo配置对象 * @throws IOException */ public static void writeToFile(BitMatrix matrix, String format, String imagePath, String logoPath, MatrixToLogoImageConfig logoConfig) throws IOException { @@ -240,14 +210,10 @@ public static void writeToFile(BitMatrix matrix, String format, String imagePath /** * 将照片logo添加到二维码中间 * - * @param image - * 生成的二维码照片对象 - * @param imagePath - * 照片保存路径 - * @param logoPath - * logo照片路径 - * @param formate - * 照片格式 + * @param image 生成的二维码照片对象 + * @param imagePath 照片保存路径 + * @param logoPath logo照片路径 + * @param formate 照片格式 */ public static void overlapImage(BufferedImage image, String formate, String imagePath, String logoPath, MatrixToLogoImageConfig logoConfig) throws IOException { BufferedImage logo = ImageIO.read(new File(logoPath)); diff --git a/common/src/main/java/pro/tools/data/text/ToolStrCompress.java b/common/src/main/java/pro/tools/data/text/ToolStrCompress.java new file mode 100644 index 0000000..e98222b --- /dev/null +++ b/common/src/main/java/pro/tools/data/text/ToolStrCompress.java @@ -0,0 +1,96 @@ +package pro.tools.data.text; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +/** + * Module: ZipUtil.java + * Description: 对字符串的压缩及解压 + * Company: + * Author: pantp + * Date: May 6, 2012 + */ +public class ToolStrCompress { + + public static void main(String[] args) throws IOException { + // 字符串超过一定的长度 + String str = "ABCdef123中文~!@#$%^&*()_+{};/1111111111111111111111111AAAAAAAAAAAJDLFJDLFJDLFJLDFFFFJEIIIIIIIIIIFJJJJJJJJJJJJALLLLLLLLLLLLLLLLLLLLLL" + + "LLppppppppppppppppppppppppppppppppppppppppp===========================------------------------------iiiiiiiiiiiiiiiiiiiiiii"; + str = "美国学者 Dime 和 Henman 为解决信息公开传送和密钥管理问题,提出一种新的密钥交换协议,允许在不安全的媒体上的通讯双方交换信息,安全地达成一致的密钥,这就是 “公开密钥系统”。与对称加密算法不同,非对称加密算法需要两个密钥:公开密钥(publickey)和私有密钥(privatekey)。公开密钥与私有密钥是一对,如果用公开密钥对数据进行加密,只有用对应的私有密钥才能解密;如果用私有密钥对数据进行加密,那么只有用对应的公开密钥才能解密。因为加密和解密使用的是两个不同的密钥,所以这种算法叫作非对称加密算法。工作过程如下图所示,甲乙之间使用非对称加密的方式完成了重要信息的安全传输。非对称加密工作过程简要示意图非对称加密工作过程简要示意图美国学者 Dime 和 Henman 为解决信息公开传送和密钥管理问题,提出一种新的密钥交换协议,允许在不安全的媒体上的通讯双方交换信息,安全地达成一致的密钥,这就是 “公开密钥系统”。与对称加密算法不同,非对称加密算法需要两个密钥:公开密钥(publickey)和私有密钥(privatekey)。公开密钥与私有密钥是一对,如果用公开密钥对数据进行加密,只有用对应的私有密钥才能解密;如果用私有密钥对数据进行加密,那么只有用对应的公开密钥才能解密。因为加密和解密使用的是两个不同的密钥,所以这种算法叫作非对称加密算法。工作过程如下图所示,甲乙之间使用非对称加密的方式完成了重要信息的安全传输。非对称加密工作过程简要示意图非对称加密工作过程简要示意图"; +// str = "1"; + + System.out.println("\n原始的字符串为------->" + str); + float len0 = str.length(); + System.out.println("原始的字符串长度为------->" + len0); + + String ys = compress(str); + System.out.println("\n压缩后的字符串为----->" + ys); + float len1 = ys.length(); + System.out.println("压缩后的字符串长度为----->" + len1); + + String jy = unCompress(ys); + System.out.println("\n解压缩后的字符串为--->" + jy); + System.out.println("解压缩后的字符串长度为--->" + jy.length()); + + System.out.println("\n压缩比例为" + len1 / len0); + + //判断 + if (str.equals(jy)) { + System.out.println("先压缩再解压以后字符串和原来的是一模一样的"); + } + } + + /** + * 字符串的压缩 + * + * @param str 待压缩的字符串 + * @return 返回压缩后的字符串 + * @throws IOException + */ + public static String compress(String str) throws IOException { + if (null == str || str.length() <= 0) { + return str; + } + // 创建一个新的 byte 数组输出流 + ByteArrayOutputStream out = new ByteArrayOutputStream(); + // 使用默认缓冲区大小创建新的输出流 + GZIPOutputStream gzip = new GZIPOutputStream(out); + // 将 b.length 个字节写入此输出流 + gzip.write(str.getBytes()); + gzip.close(); + // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 + return out.toString("UTF-8"); + } + + /** + * 字符串的解压 + * + * @param str 对字符串解压 + * @return 返回解压缩后的字符串 + * @throws IOException + */ + public static String unCompress(String str) throws IOException { + if (null == str || str.length() <= 0) { + return str; + } + // 创建一个新的 byte 数组输出流 + ByteArrayOutputStream out = new ByteArrayOutputStream(); + // 创建一个 ByteArrayInputStream,使用 buf 作为其缓冲区数组 + ByteArrayInputStream in = new ByteArrayInputStream(str + .getBytes("UTF-8")); + // 使用默认缓冲区大小创建新的输入流 + GZIPInputStream gzip = new GZIPInputStream(in); + byte[] buffer = new byte[256]; + int n = 0; + while ((n = gzip.read(buffer)) >= 0) {// 将未压缩数据读入字节数组 + // 将指定 byte 数组中从偏移量 off 开始的 len 个字节写入此 byte数组输出流 + out.write(buffer, 0, n); + } + // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 + return out.toString("UTF-8"); + } + +} diff --git a/security/src/main/java/pro/tools/security/sm/SM2.java b/security/src/main/java/pro/tools/security/sm/SM2.java new file mode 100644 index 0000000..73c022c --- /dev/null +++ b/security/src/main/java/pro/tools/security/sm/SM2.java @@ -0,0 +1,712 @@ +package pro.tools.security.sm; + +import org.bouncycastle.crypto.params.ECDomainParameters; +import org.bouncycastle.math.ec.ECCurve; +import org.bouncycastle.math.ec.ECPoint; + +import java.io.*; +import java.math.BigInteger; +import java.security.SecureRandom; +import java.util.Arrays; + +/** + * SM2公钥加密算法实现 包括 -签名,验签 -密钥交换 -公钥加密,私钥解密 + * + * @author SeanDragon + */ +public class SM2 { + private static final int DIGEST_LENGTH = 32; + private static BigInteger n = new BigInteger( + "FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "7203DF6B" + "21C6052B" + "53BBF409" + "39D54123", 16); + private static BigInteger p = new BigInteger( + "FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "00000000" + "FFFFFFFF" + "FFFFFFFF", 16); + private static BigInteger a = new BigInteger( + "FFFFFFFE" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "FFFFFFFF" + "00000000" + "FFFFFFFF" + "FFFFFFFC", 16); + private static BigInteger b = new BigInteger( + "28E9FA9E" + "9D9F5E34" + "4D5A9E4B" + "CF6509A7" + "F39789F5" + "15AB8F92" + "DDBCBD41" + "4D940E93", 16); + private static BigInteger gx = new BigInteger( + "32C4AE2C" + "1F198119" + "5F990446" + "6A39C994" + "8FE30BBF" + "F2660BE1" + "715A4589" + "334C74C7", 16); + private static BigInteger gy = new BigInteger( + "BC3736A2" + "F4F6779C" + "59BDCEE3" + "6B692153" + "D0A9877C" + "C62A4740" + "02DF32E5" + "2139F0A0", 16); + private static ECDomainParameters ecc_bc_spec; + private static int w = (int) Math.ceil(n.bitLength() * 1.0 / 2) - 1; + private static BigInteger _2w = new BigInteger("2").pow(w); + private static SecureRandom random = new SecureRandom(); + private static ECCurve.Fp curve; + private static ECPoint G; + + public SM2() { + curve = new ECCurve.Fp(p, // q + a, // a + b); // b + G = curve.createPoint(gx, gy); + ecc_bc_spec = new ECDomainParameters(curve, G, n); + } + + /** + * 以16进制打印字节数组 + * + * @param bytes + */ + private static void printHexString(byte[] bytes) { + for (byte b : bytes) { + String hex = Integer.toHexString(b & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + System.out.print(hex.toUpperCase()); + } + System.out.println(); + } + + /** + * 随机数生成器 + * + * @param max + * @return + */ + private static BigInteger random(BigInteger max) { + BigInteger r = new BigInteger(256, random); + while (r.compareTo(max) >= 0) { + r = new BigInteger(128, random); + } + return r; + } + + /** + * 字节数组拼接 + * + * @param params + * @return + */ + private static byte[] join(byte[]... params) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] res = null; + try { + for (int i = 0; i < params.length; i++) { + baos.write(params[i]); + } + res = baos.toByteArray(); + } catch (IOException e) { + e.printStackTrace(); + } + return res; + } + + /** + * sm3摘要 + * + * @param params + * @return + */ + private static byte[] sm3hash(byte[]... params) { + byte[] res = null; + try { + res = SM3.hash(join(params)); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return res; + } + + // /** + // * SHA摘要 + // * @param x2 + // * @param M + // * @param y2 + // * @return + // */ + // private byte[] calculateHash(BigInteger x2, byte[] M, BigInteger y2) { + // ShortenedDigest digest = new ShortenedDigest(new SHA256Digest(), + // DIGEST_LENGTH); + // byte[] buf = x2.toByteArray(); + // digest.update(buf, 0, buf.length); + // digest.update(M, 0, M.length); + // buf = y2.toByteArray(); + // digest.update(buf, 0, buf.length); + // + // buf = new byte[DIGEST_LENGTH]; + // digest.doFinal(buf, 0); + // + // return buf; + // } + + /** + * 取得用户标识字节数组 + * + * @param IDA + * @param aPublicKey + * @return + */ + private static byte[] ZA(String IDA, ECPoint aPublicKey) { + byte[] idaBytes = IDA.getBytes(); + int entlenA = idaBytes.length * 8; + byte[] ENTLA = new byte[]{(byte) (entlenA & 0xFF00), (byte) (entlenA & 0x00FF)}; + byte[] ZA = sm3hash(ENTLA, idaBytes, a.toByteArray(), b.toByteArray(), gx.toByteArray(), gy.toByteArray(), + aPublicKey.getXCoord().toBigInteger().toByteArray(), + aPublicKey.getYCoord().toBigInteger().toByteArray()); + return ZA; + } + + /** + * 密钥派生函数 + * + * @param Z + * @param klen 生成klen字节数长度的密钥 + * @return + */ + private static byte[] KDF(byte[] Z, int klen) { + int ct = 1; + int end = (int) Math.ceil(klen * 1.0 / 32); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + for (int i = 1; i < end; i++) { + baos.write(sm3hash(Z, SM3.toByteArray(ct))); + ct++; + } + byte[] last = sm3hash(Z, SM3.toByteArray(ct)); + if (klen % 32 == 0) { + baos.write(last); + } else + baos.write(last, 0, klen % 32); + return baos.toByteArray(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 判断字节数组是否全0 + * + * @param buffer + * @return + */ + private boolean allZero(byte[] buffer) { + for (byte aBuffer : buffer) { + if (aBuffer != 0) + return false; + } + return true; + } + + /** + * 公钥加密 + * + * @param input 加密原文 + * @param publicKey 公钥 + * @return + */ + public byte[] encrypt(String input, ECPoint publicKey) { + + byte[] inputBuffer = input.getBytes(); + + byte[] C1Buffer; + ECPoint kpb; + byte[] t; + do { + /* 1 产生随机数k,k属于[1, n-1] */ + BigInteger k = random(n); + + /* 2 计算椭圆曲线点C1 = [k]G = (x1, y1) */ + ECPoint C1 = G.multiply(k); + C1Buffer = C1.getEncoded(false); + + /* + * 3 计算椭圆曲线点 S = [h]Pb + */ + BigInteger h = ecc_bc_spec.getH(); + if (h != null) { + ECPoint S = publicKey.multiply(h); + if (S.isInfinity()) + throw new IllegalStateException(); + } + + /* 4 计算 [k]PB = (x2, y2) */ + kpb = publicKey.multiply(k).normalize(); + + /* 5 计算 t = KDF(x2||y2, klen) */ + byte[] kpbBytes = kpb.getEncoded(false); + t = KDF(kpbBytes, inputBuffer.length); + // DerivationFunction kdf = new KDF1BytesGenerator(new + // ShortenedDigest(new SHA256Digest(), DIGEST_LENGTH)); + // + // t = new byte[inputBuffer.length]; + // kdf.init(new ISO18033KDFParameters(kpbBytes)); + // kdf.generateBytes(t, 0, t.length); + } while (allZero(t)); + + /* 6 计算C2=M^t */ + byte[] C2 = new byte[inputBuffer.length]; + for (int i = 0; i < inputBuffer.length; i++) { + C2[i] = (byte) (inputBuffer[i] ^ t[i]); + } + + /* 7 计算C3 = Hash(x2 || M || y2) */ + byte[] C3 = sm3hash(kpb.getXCoord().toBigInteger().toByteArray(), inputBuffer, + kpb.getYCoord().toBigInteger().toByteArray()); + + /* 8 输出密文 C=C1 || C2 || C3 */ + + byte[] encryptResult = new byte[C1Buffer.length + C2.length + C3.length]; + + System.arraycopy(C1Buffer, 0, encryptResult, 0, C1Buffer.length); + System.arraycopy(C2, 0, encryptResult, C1Buffer.length, C2.length); + System.arraycopy(C3, 0, encryptResult, C1Buffer.length + C2.length, C3.length); + + return encryptResult; + } + + /** + * 私钥解密 + * + * @param encryptData 密文数据字节数组 + * @param privateKey 解密私钥 + * @return + */ + public String decrypt(byte[] encryptData, BigInteger privateKey) { + + byte[] C1Byte = new byte[65]; + System.arraycopy(encryptData, 0, C1Byte, 0, C1Byte.length); + + ECPoint C1 = curve.decodePoint(C1Byte).normalize(); + + /* + * 计算椭圆曲线点 S = [h]C1 是否为无穷点 + */ + BigInteger h = ecc_bc_spec.getH(); + if (h != null) { + ECPoint S = C1.multiply(h); + if (S.isInfinity()) + throw new IllegalStateException(); + } + /* 计算[dB]C1 = (x2, y2) */ + ECPoint dBC1 = C1.multiply(privateKey).normalize(); + + /* 计算t = KDF(x2 || y2, klen) */ + byte[] dBC1Bytes = dBC1.getEncoded(false); + int klen = encryptData.length - 65 - DIGEST_LENGTH; + byte[] t = KDF(dBC1Bytes, klen); + // DerivationFunction kdf = new KDF1BytesGenerator(new + // ShortenedDigest(new SHA256Digest(), DIGEST_LENGTH)); + // if (debug) + // System.out.println("klen = " + klen); + // kdf.init(new ISO18033KDFParameters(dBC1Bytes)); + // kdf.generateBytes(t, 0, t.length); + + if (allZero(t)) { + System.err.println("all zero"); + throw new IllegalStateException(); + } + + /* 5 计算M'=C2^t */ + byte[] M = new byte[klen]; + for (int i = 0; i < M.length; i++) { + M[i] = (byte) (encryptData[C1Byte.length + i] ^ t[i]); + } + /* 6 计算 u = Hash(x2 || M' || y2) 判断 u == C3是否成立 */ + byte[] C3 = new byte[DIGEST_LENGTH]; + + System.arraycopy(encryptData, encryptData.length - DIGEST_LENGTH, C3, 0, DIGEST_LENGTH); + byte[] u = sm3hash(dBC1.getXCoord().toBigInteger().toByteArray(), M, + dBC1.getYCoord().toBigInteger().toByteArray()); + if (Arrays.equals(u, C3)) { + try { + return new String(M, "UTF8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return null; + } else { + return null; + } + + } + + /** + * 判断是否在范围内 + * + * @param param + * @param min + * @param max + * @return + */ + private boolean between(BigInteger param, BigInteger min, BigInteger max) { + if (param.compareTo(min) >= 0 && param.compareTo(max) < 0) { + return true; + } else { + return false; + } + } + + /** + * 判断生成的公钥是否合法 + * + * @param publicKey + * @return + */ + private boolean checkPublicKey(ECPoint publicKey) { + + if (!publicKey.isInfinity()) { + + BigInteger x = publicKey.getXCoord().toBigInteger(); + BigInteger y = publicKey.getYCoord().toBigInteger(); + + if (between(x, new BigInteger("0"), p) && between(y, new BigInteger("0"), p)) { + + BigInteger xResult = x.pow(3).add(a.multiply(x)).add(b).mod(p); + + BigInteger yResult = y.pow(2).mod(p); + + return yResult.equals(xResult) && publicKey.multiply(n).isInfinity(); + } + } + return false; + } + + /** + * 生成密钥对 + * + * @return + */ + public SM2KeyPair generateKeyPair() { + + BigInteger d = random(n.subtract(new BigInteger("1"))); + + SM2KeyPair keyPair = new SM2KeyPair(G.multiply(d).normalize(), d); + + if (checkPublicKey(keyPair.getPublicKey())) { + return keyPair; + } else { + return null; + } + } + + /** + * 导出公钥到本地 + * + * @param publicKey + * @param path + */ + public void exportPublicKey(ECPoint publicKey, String path) { + File file = new File(path); + try { + if (!file.exists()) + file.createNewFile(); + byte buffer[] = publicKey.getEncoded(false); + FileOutputStream fos = new FileOutputStream(file); + fos.write(buffer); + fos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 从本地导入公钥 + * + * @param path + * @return + */ + public ECPoint importPublicKey(String path) { + File file = new File(path); + try { + if (!file.exists()) + return null; + FileInputStream fis = new FileInputStream(file); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + byte buffer[] = new byte[16]; + int size; + while ((size = fis.read(buffer)) != -1) { + baos.write(buffer, 0, size); + } + fis.close(); + return curve.decodePoint(baos.toByteArray()); + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * 导出私钥到本地 + * + * @param privateKey + * @param path + */ + public void exportPrivateKey(BigInteger privateKey, String path) { + File file = new File(path); + try { + if (!file.exists()) + file.createNewFile(); + ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)); + oos.writeObject(privateKey); + oos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 从本地导入私钥 + * + * @param path + * @return + */ + public BigInteger importPrivateKey(String path) { + File file = new File(path); + try { + if (!file.exists()) + return null; + FileInputStream fis = new FileInputStream(file); + ObjectInputStream ois = new ObjectInputStream(fis); + BigInteger res = (BigInteger) (ois.readObject()); + ois.close(); + fis.close(); + return res; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 签名 + * + * @param M 签名信息 + * @param IDA 签名方唯一标识 + * @param keyPair 签名方密钥对 + * @return 签名 + */ + public Signature sign(String M, String IDA, SM2KeyPair keyPair) { + byte[] ZA = ZA(IDA, keyPair.getPublicKey()); + byte[] M_ = join(ZA, M.getBytes()); + BigInteger e = new BigInteger(1, sm3hash(M_)); + // BigInteger k = new BigInteger( + // "6CB28D99 385C175C 94F94E93 4817663F C176D925 DD72B727 260DBAAE + // 1FB2F96F".replace(" ", ""), 16); + BigInteger k; + BigInteger r; + do { + k = random(n); + ECPoint p1 = G.multiply(k).normalize(); + BigInteger x1 = p1.getXCoord().toBigInteger(); + r = e.add(x1); + r = r.mod(n); + } while (r.equals(BigInteger.ZERO) || r.add(k).equals(n)); + + BigInteger s = ((keyPair.getPrivateKey().add(BigInteger.ONE).modInverse(n)) + .multiply((k.subtract(r.multiply(keyPair.getPrivateKey()))).mod(n))).mod(n); + + return new Signature(r, s); + } + + /** + * 验签 + * + * @param M 签名信息 + * @param signature 签名 + * @param IDA 签名方唯一标识 + * @param aPublicKey 签名方公钥 + * @return true or false + */ + public boolean verify(String M, Signature signature, String IDA, ECPoint aPublicKey) { + if (!between(signature.r, BigInteger.ONE, n)) + return false; + if (!between(signature.s, BigInteger.ONE, n)) + return false; + + byte[] M_ = join(ZA(IDA, aPublicKey), M.getBytes()); + BigInteger e = new BigInteger(1, sm3hash(M_)); + BigInteger t = signature.r.add(signature.s).mod(n); + + if (t.equals(BigInteger.ZERO)) + return false; + + ECPoint p1 = G.multiply(signature.s).normalize(); + ECPoint p2 = aPublicKey.multiply(t).normalize(); + BigInteger x1 = p1.add(p2).normalize().getXCoord().toBigInteger(); + BigInteger R = e.add(x1).mod(n); + if (R.equals(signature.r)) + return true; + return false; + } + + /** + * 传输实体类 + * + * @author Potato + */ + private static class TransportEntity implements Serializable { + final byte[] R; //R点 + final byte[] S; //验证S + final byte[] Z; //用户标识 + final byte[] K; //公钥 + + public TransportEntity(byte[] r, byte[] s, byte[] z, ECPoint pKey) { + R = r; + S = s; + Z = z; + K = pKey.getEncoded(false); + } + } + + /** + * 密钥协商辅助类 + * + * @author Potato + */ + public static class KeyExchange { + BigInteger rA; + ECPoint RA; + ECPoint V; + byte[] Z; + byte[] key; + + String ID; + SM2KeyPair keyPair; + + public KeyExchange(String ID, SM2KeyPair keyPair) { + this.ID = ID; + this.keyPair = keyPair; + this.Z = ZA(ID, keyPair.getPublicKey()); + } + + /** + * 密钥协商发起第一步 + * + * @return + */ + public TransportEntity keyExchange_1() { + rA = random(n); + // rA=new BigInteger("83A2C9C8 B96E5AF7 0BD480B4 72409A9A 327257F1 + // EBB73F5B 073354B2 48668563".replace(" ", ""),16); + RA = G.multiply(rA).normalize(); + return new TransportEntity(RA.getEncoded(false), null, Z, keyPair.getPublicKey()); + } + + /** + * 密钥协商响应方 + * + * @param entity 传输实体 + * @return + */ + public TransportEntity keyExchange_2(TransportEntity entity) { + BigInteger rB = random(n); + // BigInteger rB=new BigInteger("33FE2194 0342161C 55619C4A 0C060293 + // D543C80A F19748CE 176D8347 7DE71C80".replace(" ", ""),16); + ECPoint RB = G.multiply(rB).normalize(); + + this.rA = rB; + this.RA = RB; + + BigInteger x2 = RB.getXCoord().toBigInteger(); + x2 = _2w.add(x2.and(_2w.subtract(BigInteger.ONE))); + + BigInteger tB = keyPair.getPrivateKey().add(x2.multiply(rB)).mod(n); + ECPoint RA = curve.decodePoint(entity.R).normalize(); + + BigInteger x1 = RA.getXCoord().toBigInteger(); + x1 = _2w.add(x1.and(_2w.subtract(BigInteger.ONE))); + + ECPoint aPublicKey = curve.decodePoint(entity.K).normalize(); + ECPoint temp = aPublicKey.add(RA.multiply(x1).normalize()).normalize(); + ECPoint V = temp.multiply(ecc_bc_spec.getH().multiply(tB)).normalize(); + if (V.isInfinity()) + throw new IllegalStateException(); + this.V = V; + + byte[] xV = V.getXCoord().toBigInteger().toByteArray(); + byte[] yV = V.getYCoord().toBigInteger().toByteArray(); + byte[] KB = KDF(join(xV, yV, entity.Z, this.Z), 16); + key = KB; + System.out.print("协商得B密钥:"); + printHexString(KB); + byte[] sB = sm3hash(new byte[]{0x02}, yV, + sm3hash(xV, entity.Z, this.Z, RA.getXCoord().toBigInteger().toByteArray(), + RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(), + RB.getYCoord().toBigInteger().toByteArray())); + return new TransportEntity(RB.getEncoded(false), sB, this.Z, keyPair.getPublicKey()); + } + + /** + * 密钥协商发起方第二步 + * + * @param entity 传输实体 + */ + public TransportEntity keyExchange_3(TransportEntity entity) { + BigInteger x1 = RA.getXCoord().toBigInteger(); + x1 = _2w.add(x1.and(_2w.subtract(BigInteger.ONE))); + + BigInteger tA = keyPair.getPrivateKey().add(x1.multiply(rA)).mod(n); + ECPoint RB = curve.decodePoint(entity.R).normalize(); + + BigInteger x2 = RB.getXCoord().toBigInteger(); + x2 = _2w.add(x2.and(_2w.subtract(BigInteger.ONE))); + + ECPoint bPublicKey = curve.decodePoint(entity.K).normalize(); + ECPoint temp = bPublicKey.add(RB.multiply(x2).normalize()).normalize(); + ECPoint U = temp.multiply(ecc_bc_spec.getH().multiply(tA)).normalize(); + if (U.isInfinity()) + throw new IllegalStateException(); + this.V = U; + + byte[] xU = U.getXCoord().toBigInteger().toByteArray(); + byte[] yU = U.getYCoord().toBigInteger().toByteArray(); + byte[] KA = KDF(join(xU, yU, + this.Z, entity.Z), 16); + key = KA; + System.out.print("协商得A密钥:"); + printHexString(KA); + byte[] s1 = sm3hash(new byte[]{0x02}, yU, + sm3hash(xU, this.Z, entity.Z, RA.getXCoord().toBigInteger().toByteArray(), + RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(), + RB.getYCoord().toBigInteger().toByteArray())); + if (Arrays.equals(entity.S, s1)) + System.out.println("B->A 密钥确认成功"); + else + System.out.println("B->A 密钥确认失败"); + byte[] sA = sm3hash(new byte[]{0x03}, yU, + sm3hash(xU, this.Z, entity.Z, RA.getXCoord().toBigInteger().toByteArray(), + RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(), + RB.getYCoord().toBigInteger().toByteArray())); + + return new TransportEntity(RA.getEncoded(false), sA, this.Z, keyPair.getPublicKey()); + } + + /** + * 密钥确认最后一步 + * + * @param entity 传输实体 + */ + public void keyExchange_4(TransportEntity entity) { + byte[] xV = V.getXCoord().toBigInteger().toByteArray(); + byte[] yV = V.getYCoord().toBigInteger().toByteArray(); + ECPoint RA = curve.decodePoint(entity.R).normalize(); + byte[] s2 = sm3hash(new byte[]{0x03}, yV, + sm3hash(xV, entity.Z, this.Z, RA.getXCoord().toBigInteger().toByteArray(), + RA.getYCoord().toBigInteger().toByteArray(), this.RA.getXCoord().toBigInteger().toByteArray(), + this.RA.getYCoord().toBigInteger().toByteArray())); + if (Arrays.equals(entity.S, s2)) + System.out.println("A->B 密钥确认成功"); + else + System.out.println("A->B 密钥确认失败"); + } + } + + public static class Signature { + BigInteger r; + BigInteger s; + + Signature(BigInteger r, BigInteger s) { + this.r = r; + this.s = s; + } + + public String toString() { + return r.toString(16) + "," + s.toString(16); + } + } +} \ No newline at end of file diff --git a/security/src/main/java/pro/tools/security/sm/SM2KeyPair.java b/security/src/main/java/pro/tools/security/sm/SM2KeyPair.java new file mode 100644 index 0000000..ceea124 --- /dev/null +++ b/security/src/main/java/pro/tools/security/sm/SM2KeyPair.java @@ -0,0 +1,30 @@ +package pro.tools.security.sm; + +import org.bouncycastle.math.ec.ECPoint; + +import java.math.BigInteger; + +/** + * SM2密钥对 + * + * @author SeanDragon + */ +public class SM2KeyPair { + + private final ECPoint publicKey; + private final BigInteger privateKey; + + SM2KeyPair(ECPoint publicKey, BigInteger privateKey) { + this.publicKey = publicKey; + this.privateKey = privateKey; + } + + public ECPoint getPublicKey() { + return publicKey; + } + + public BigInteger getPrivateKey() { + return privateKey; + } + +} \ No newline at end of file diff --git a/security/src/main/java/pro/tools/security/sm/SM3.java b/security/src/main/java/pro/tools/security/sm/SM3.java new file mode 100644 index 0000000..f5bd0a0 --- /dev/null +++ b/security/src/main/java/pro/tools/security/sm/SM3.java @@ -0,0 +1,206 @@ +package pro.tools.security.sm; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.math.BigInteger; +import java.util.Arrays; + +/** + * SM3杂凑算法实现 + * + * @author Potato + */ +public class SM3 { + + private static final String ivHexStr = "7380166f 4914b2b9 172442d7 da8a0600 a96f30bc 163138aa e38dee4d b0fb0e4e"; + private static final BigInteger IV = new BigInteger(ivHexStr.replaceAll(" ", + ""), 16); + private static final Integer Tj15 = Integer.valueOf("79cc4519", 16); + private static final Integer Tj63 = Integer.valueOf("7a879d8a", 16); + private static final byte[] FirstPadding = {(byte) 0x80}; + private static final byte[] ZeroPadding = {(byte) 0x00}; + private static char[] hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', + '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + + private static int T(int j) { + if (j >= 0 && j <= 15) { + return Tj15; + } else if (j >= 16 && j <= 63) { + return Tj63; + } else { + throw new RuntimeException("data invalid"); + } + } + + private static Integer FF(Integer x, Integer y, Integer z, int j) { + if (j >= 0 && j <= 15) { + return x ^ y ^ z; + } else if (j >= 16 && j <= 63) { + return (x & y) + | (x & z) + | (y & z); + } else { + throw new RuntimeException("data invalid"); + } + } + + private static Integer GG(Integer x, Integer y, Integer z, int j) { + if (j >= 0 && j <= 15) { + return x ^ y ^ z; + } else if (j >= 16 && j <= 63) return (x & y) + | (~x & z); + else { + throw new RuntimeException("data invalid"); + } + } + + private static Integer P0(Integer x) { + return x + ^ Integer.rotateLeft(x, 9) + ^ Integer.rotateLeft(x, 17); + } + + private static Integer P1(Integer x) { + return x + ^ Integer.rotateLeft(x, 15) + ^ Integer.rotateLeft(x, 23); + } + + private static byte[] padding(byte[] source) throws IOException { + long l = source.length * 8; + long k = 448 - (l + 1) % 512; + if (k < 0) { + k = k + 512; + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + baos.write(source); + baos.write(FirstPadding); + long i = k - 7; + while (i > 0) { + baos.write(ZeroPadding); + i -= 8; + } + baos.write(long2bytes(l)); + return baos.toByteArray(); + } + + private static byte[] long2bytes(long l) { + byte[] bytes = new byte[8]; + for (int i = 0; i < 8; i++) { + bytes[i] = (byte) (l >>> ((7 - i) * 8)); + } + return bytes; + } + + static byte[] hash(byte[] source) throws IOException { + byte[] m1 = padding(source); + int n = m1.length / (512 / 8); + byte[] b; + byte[] vi = IV.toByteArray(); + byte[] vi1 = null; + for (int i = 0; i < n; i++) { + b = Arrays.copyOfRange(m1, i * 64, (i + 1) * 64); + vi1 = CF(vi, b); + vi = vi1; + } + return vi1; + } + + private static byte[] CF(byte[] vi, byte[] bi) throws IOException { + int a, b, c, d, e, f, g, h; + a = toInteger(vi, 0); + b = toInteger(vi, 1); + c = toInteger(vi, 2); + d = toInteger(vi, 3); + e = toInteger(vi, 4); + f = toInteger(vi, 5); + g = toInteger(vi, 6); + h = toInteger(vi, 7); + + int[] w = new int[68]; + int[] w1 = new int[64]; + for (int i = 0; i < 16; i++) { + w[i] = toInteger(bi, i); + } + for (int j = 16; j < 68; j++) { + w[j] = P1(w[j - 16] ^ w[j - 9] ^ Integer.rotateLeft(w[j - 3], 15)) + ^ Integer.rotateLeft(w[j - 13], 7) ^ w[j - 6]; + } + for (int j = 0; j < 64; j++) { + w1[j] = w[j] ^ w[j + 4]; + } + int ss1, ss2, tt1, tt2; + for (int j = 0; j < 64; j++) { + ss1 = Integer + .rotateLeft( + Integer.rotateLeft(a, 12) + e + + Integer.rotateLeft(T(j), j), 7); + ss2 = ss1 ^ Integer.rotateLeft(a, 12); + tt1 = FF(a, b, c, j) + d + ss2 + w1[j]; + tt2 = GG(e, f, g, j) + h + ss1 + w[j]; + d = c; + c = Integer.rotateLeft(b, 9); + b = a; + a = tt1; + h = g; + g = Integer.rotateLeft(f, 19); + f = e; + e = P0(tt2); + } + byte[] v = toByteArray(a, b, c, d, e, f, g, h); + for (int i = 0; i < v.length; i++) { + v[i] = (byte) (v[i] ^ vi[i]); + } + return v; + } + + private static int toInteger(byte[] source, int index) { + StringBuilder valueStr = new StringBuilder(); + for (int i = 0; i < 4; i++) { + valueStr.append(hexDigits[(byte) ((source[index * 4 + i] & 0xF0) >> 4)]); + valueStr.append(hexDigits[(byte) (source[index * 4 + i] & 0x0F)]); + } + return Long.valueOf(valueStr.toString(), 16).intValue(); + + } + + private static byte[] toByteArray(int a, int b, int c, int d, int e, int f, + int g, int h) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(32); + baos.write(toByteArray(a)); + baos.write(toByteArray(b)); + baos.write(toByteArray(c)); + baos.write(toByteArray(d)); + baos.write(toByteArray(e)); + baos.write(toByteArray(f)); + baos.write(toByteArray(g)); + baos.write(toByteArray(h)); + return baos.toByteArray(); + } + + static byte[] toByteArray(int i) { + byte[] byteArray = new byte[4]; + byteArray[0] = (byte) (i >>> 24); + byteArray[1] = (byte) ((i & 0xFFFFFF) >>> 16); + byteArray[2] = (byte) ((i & 0xFFFF) >>> 8); + byteArray[3] = (byte) (i & 0xFF); + return byteArray; + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n = 256 + n; + int d1 = n / 16; + int d2 = n % 16; + return "" + hexDigits[d1] + hexDigits[d2]; + } + + public static String byteArrayToHexString(byte[] b) { + StringBuilder resultSb = new StringBuilder(); + for (byte aB : b) { + resultSb.append(byteToHexString(aB)); + } + return resultSb.toString(); + } +} \ No newline at end of file From eb1c1840cd5e601aa967fd57b6fd4d193678f55d Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Fri, 24 Aug 2018 16:26:26 +0800 Subject: [PATCH 51/69] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=8C=E7=BB=B4?= =?UTF-8?q?=E7=A0=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pro/tools/data/image/ToolBarCode.java | 21 +++++++++--- security/src/test/java/TestBarCode.java | 34 +++++++++++++++++++ 2 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 security/src/test/java/TestBarCode.java diff --git a/common/src/main/java/pro/tools/data/image/ToolBarCode.java b/common/src/main/java/pro/tools/data/image/ToolBarCode.java index 19ee9e3..a77ad3b 100644 --- a/common/src/main/java/pro/tools/data/image/ToolBarCode.java +++ b/common/src/main/java/pro/tools/data/image/ToolBarCode.java @@ -53,8 +53,7 @@ public static void encode(String content, int width, int height, String fileType Writer writer = new QRCodeWriter(); BitMatrix matrix = writer.encode(data, QR_CODE, width, height); - File file = new File(savePath); - MatrixToImageWriter.writeToFile(matrix, fileType, file); + MatrixToImageWriter.writeToPath(matrix, fileType, Paths.get(savePath)); } @@ -68,10 +67,22 @@ public static void encode(String content, int width, int height, String fileType * @param fileType 文件类型,如png * @param savePath 保存路径 */ - public static void encodeLogo(String content, int width, int height, String logoPath, String fileType, String savePath) throws IOException { - BitMatrix matrix = MatrixToImageWriterEx.createQRCode(content, width, height); - MatrixToLogoImageConfig logoConfig = new MatrixToLogoImageConfig(Color.BLUE, 4); + public static void encodeLogo(String content, int width, int height, String logoPath, String fileType, String savePath) throws IOException, WriterException { + Charset charset = Charset.forName("UTF-8"); + CharsetEncoder encoder = charset.newEncoder(); + + byte[] b = encoder.encode(CharBuffer.wrap(content)).array(); + String data = new String(b, "iso8859-1"); + + Writer writer = new QRCodeWriter(); + BitMatrix matrix = writer.encode(data, QR_CODE, width, height); + MatrixToLogoImageConfig logoConfig = new MatrixToLogoImageConfig(Color.BLACK, 10); MatrixToImageWriterEx.writeToFile(matrix, fileType, savePath, logoPath, logoConfig); + + +// BitMatrix matrix = MatrixToImageWriterEx.createQRCode(content, width, height); +// MatrixToLogoImageConfig logoConfig = new MatrixToLogoImageConfig(Color.BLUE, 4); +// MatrixToImageWriterEx.writeToFile(matrix, fileType, savePath, logoPath, logoConfig); } /** diff --git a/security/src/test/java/TestBarCode.java b/security/src/test/java/TestBarCode.java new file mode 100644 index 0000000..c18a1e8 --- /dev/null +++ b/security/src/test/java/TestBarCode.java @@ -0,0 +1,34 @@ +import com.google.zxing.NotFoundException; +import com.google.zxing.WriterException; +import org.junit.Test; +import pro.tools.data.image.ToolBarCode; + +import java.io.IOException; +import java.util.UUID; + +public class TestBarCode { + + String path = "E:/qrcode.png"; + + @Test + public void test1() throws IOException, WriterException { + String str = "425a6839314159265359ad39bc0700007c9ef910067ff03f5f3cf0800a7fffffffffffffff8fe0c0028ec803308654d264d469ea3d2613d434da9899909a3469b44310302000c800d326401a212a7e9e421a53c189a053c34d29e991906a0068c0264320034c118d0e343434340340620680c800034d000d00c80000061228224d3d28fd468434d3ca07a9a32680680001a64f500d34343d468d3d13ca1f2cdf9ebe471be7a9cea7bb0401a2e36812750372948f21a98c90585c1648283a0d41438c2e680e14466e33384322a4e64d126e04084a311b4e522638c46b15d8bb06d99b684060229c03f28129a81080c5b86a1cc38aadc65672230e040525c0b068bc6d32eae630af32fad739b62a475b4ba04a62542106585fc58418633777187460a00d6bff773e0b57bf7e1671c3599661e6414ca081abe6c54bf85f7e562a530d67356877fc70c69307c14d570d7781fcead859b82cd963c320a5f9c70de9dda42e211080c4129fa2b96dd02b9b89c04134e65a47c73cc97b4ea5966cca4ab41bbb48393ed576cd6a985d37f0e6cf31354f32e4236064b6f045291c3a02363e918b146191181796790d0916f655d2ad1d4dd1422be572baab405693c8ca5c00e7e89098c1978d0b3cd2649257273793880b428deb16a5a5495486a4a1a99899c5b704c845254050178c8d2fb44aa18439646ab0bf060e0d2b4de7940ed366546de2d5c695b4c05773b1444a596a1633b48de2536a878ba9d62483fc8439bcdc9dfca91a6c20011626380e24601c271d295196fcd858ac50ed4a7fa42aeabfc94e4a585dfb0b9525e52bf73e82224d929d13b746180ca1472c487f5eba5c592e8f29e0b45428061c63c0c4cd2cf29c554964e16550a54e476f57d1e7157d349ac93f45aa280ab262c5f7a04456935302837002446f1d9f32e753b5830251890e6860cef5b076e013c1c753db2e4a38e4274a0881b45933e09b5dbc599d649051a453723ad56875210b14152b821d6b835eb3c0781523cfe9cf7aecc7f1cfaafcd26cb1823051664a5854a3694edb18537e11403cd27dcc524165305eacd4932e50ff177245385090ad39bc07"; +// ToolBarCode.encode(str,1000,1000,"PNG",path); + ToolBarCode.encodeLogo(str, 1000, 1000, "E:/guohui.jfif", "PNG", path); + } + + @Test + public void test2() throws IOException, NotFoundException { + String decode = ToolBarCode.decode(path); + System.out.println(decode); + } + + @Test + public void test3() { + int num = 50; + for (int i = 0; i < num; i++) { + String one = UUID.randomUUID().toString().toUpperCase().replace("-", ""); + System.out.println(one); + } + } +} \ No newline at end of file From 5403bacb7d76f6abb281ae10442796da30077beb Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Thu, 9 May 2019 23:43:12 +0800 Subject: [PATCH 52/69] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=98=BF?= =?UTF-8?q?=E9=87=8C=E8=A7=84=E7=BA=A6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/pom.xml | 2 +- .../java/pro/tools/constant/RegexConst.java | 3 +- .../java/pro/tools/data/decimal/Decimal.java | 5 +- .../java/pro/tools/data/text/ToolPinYin.java | 2 +- .../pro/tools/data/text/ToolStrCompress.java | 91 ++++++++----------- .../main/java/pro/tools/file/ToolFile.java | 17 +--- .../main/java/pro/tools/system/ToolOS.java | 8 +- .../main/java/pro/tools/time/DatePlus.java | 20 ++-- .../java/pro/tools/mail/pojo/MailSend.java | 16 +++- pom.xml | 5 + .../main/java/pro/tools/security/sm/SM2.java | 57 ++++++++---- .../main/java/pro/tools/security/sm/SM3.java | 11 ++- 12 files changed, 126 insertions(+), 111 deletions(-) diff --git a/common/pom.xml b/common/pom.xml index 6b7f507..5e6b18b 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -90,7 +90,7 @@ - 1.0.0 + 1.0.1 2.56 1.9.6 2.5.1 diff --git a/common/src/main/java/pro/tools/constant/RegexConst.java b/common/src/main/java/pro/tools/constant/RegexConst.java index 835a980..8f92178 100644 --- a/common/src/main/java/pro/tools/constant/RegexConst.java +++ b/common/src/main/java/pro/tools/constant/RegexConst.java @@ -7,7 +7,8 @@ /** * 正则的常量 * - * @author SeanDragon Create By 2017-04-17 10:13 + * @author SeanDragon + * @date 2017-04-17 10:13 */ public final class RegexConst { diff --git a/common/src/main/java/pro/tools/data/decimal/Decimal.java b/common/src/main/java/pro/tools/data/decimal/Decimal.java index b28337c..0f13c2b 100644 --- a/common/src/main/java/pro/tools/data/decimal/Decimal.java +++ b/common/src/main/java/pro/tools/data/decimal/Decimal.java @@ -245,9 +245,11 @@ public Decimal sqrtN(int n) { this.bigDecimal = new BigDecimal(log, mathContext); return this; } + //endregion //region 数据变现 + @Override public String toString() { return fullStrValue(); @@ -287,13 +289,11 @@ public double moneyValue() { @Override public int intValue() { return (int) doubleValue(); - //return this.bigDecimal.intValueExact(); } @Override public long longValue() { return (long) doubleValue(); - //return this.bigDecimal.longValueExact(); } @Override @@ -332,6 +332,7 @@ public double doubleValue(int scale, RoundingMode roundingMode) { String strValue = this.fullStrValue(scale, roundingMode); return Double.valueOf(strValue); } + //endregion diff --git a/common/src/main/java/pro/tools/data/text/ToolPinYin.java b/common/src/main/java/pro/tools/data/text/ToolPinYin.java index 9d6faf3..0e0c670 100644 --- a/common/src/main/java/pro/tools/data/text/ToolPinYin.java +++ b/common/src/main/java/pro/tools/data/text/ToolPinYin.java @@ -41,7 +41,7 @@ public static String getPinYin(String src) throws BadHanyuPinyinOutputFormatComb t2 = PinyinHelper.toHanyuPinyinStringArray(aT1, t3); t4.append(t2[0]); } else { - t4.append(Character.toString(aT1)); + t4.append(aT1); } } return t4.toString(); diff --git a/common/src/main/java/pro/tools/data/text/ToolStrCompress.java b/common/src/main/java/pro/tools/data/text/ToolStrCompress.java index e98222b..7c6e505 100644 --- a/common/src/main/java/pro/tools/data/text/ToolStrCompress.java +++ b/common/src/main/java/pro/tools/data/text/ToolStrCompress.java @@ -1,5 +1,7 @@ package pro.tools.data.text; +import pro.tools.constant.StrConst; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -7,90 +9,71 @@ import java.util.zip.GZIPOutputStream; /** - * Module: ZipUtil.java - * Description: 对字符串的压缩及解压 - * Company: - * Author: pantp - * Date: May 6, 2012 + * 对字符串的压缩及解压 + * + * @author SeanDragon */ public class ToolStrCompress { - public static void main(String[] args) throws IOException { - // 字符串超过一定的长度 - String str = "ABCdef123中文~!@#$%^&*()_+{};/1111111111111111111111111AAAAAAAAAAAJDLFJDLFJDLFJLDFFFFJEIIIIIIIIIIFJJJJJJJJJJJJALLLLLLLLLLLLLLLLLLLLLL" + - "LLppppppppppppppppppppppppppppppppppppppppp===========================------------------------------iiiiiiiiiiiiiiiiiiiiiii"; - str = "美国学者 Dime 和 Henman 为解决信息公开传送和密钥管理问题,提出一种新的密钥交换协议,允许在不安全的媒体上的通讯双方交换信息,安全地达成一致的密钥,这就是 “公开密钥系统”。与对称加密算法不同,非对称加密算法需要两个密钥:公开密钥(publickey)和私有密钥(privatekey)。公开密钥与私有密钥是一对,如果用公开密钥对数据进行加密,只有用对应的私有密钥才能解密;如果用私有密钥对数据进行加密,那么只有用对应的公开密钥才能解密。因为加密和解密使用的是两个不同的密钥,所以这种算法叫作非对称加密算法。工作过程如下图所示,甲乙之间使用非对称加密的方式完成了重要信息的安全传输。非对称加密工作过程简要示意图非对称加密工作过程简要示意图美国学者 Dime 和 Henman 为解决信息公开传送和密钥管理问题,提出一种新的密钥交换协议,允许在不安全的媒体上的通讯双方交换信息,安全地达成一致的密钥,这就是 “公开密钥系统”。与对称加密算法不同,非对称加密算法需要两个密钥:公开密钥(publickey)和私有密钥(privatekey)。公开密钥与私有密钥是一对,如果用公开密钥对数据进行加密,只有用对应的私有密钥才能解密;如果用私有密钥对数据进行加密,那么只有用对应的公开密钥才能解密。因为加密和解密使用的是两个不同的密钥,所以这种算法叫作非对称加密算法。工作过程如下图所示,甲乙之间使用非对称加密的方式完成了重要信息的安全传输。非对称加密工作过程简要示意图非对称加密工作过程简要示意图"; -// str = "1"; - - System.out.println("\n原始的字符串为------->" + str); - float len0 = str.length(); - System.out.println("原始的字符串长度为------->" + len0); - - String ys = compress(str); - System.out.println("\n压缩后的字符串为----->" + ys); - float len1 = ys.length(); - System.out.println("压缩后的字符串长度为----->" + len1); - - String jy = unCompress(ys); - System.out.println("\n解压缩后的字符串为--->" + jy); - System.out.println("解压缩后的字符串长度为--->" + jy.length()); - - System.out.println("\n压缩比例为" + len1 / len0); - - //判断 - if (str.equals(jy)) { - System.out.println("先压缩再解压以后字符串和原来的是一模一样的"); - } + private ToolStrCompress() { + throw new UnsupportedOperationException("我是工具类,别初始化我。。。"); } /** * 字符串的压缩 * * @param str 待压缩的字符串 + * * @return 返回压缩后的字符串 + * * @throws IOException */ public static String compress(String str) throws IOException { if (null == str || str.length() <= 0) { return str; } - // 创建一个新的 byte 数组输出流 - ByteArrayOutputStream out = new ByteArrayOutputStream(); - // 使用默认缓冲区大小创建新的输出流 - GZIPOutputStream gzip = new GZIPOutputStream(out); - // 将 b.length 个字节写入此输出流 - gzip.write(str.getBytes()); - gzip.close(); - // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 - return out.toString("UTF-8"); + try ( + // 创建一个新的 byte 数组输出流 + ByteArrayOutputStream out = new ByteArrayOutputStream(); + // 使用默认缓冲区大小创建新的输出流 + GZIPOutputStream gzip = new GZIPOutputStream(out);) { + // 将 b.length 个字节写入此输出流 + gzip.write(str.getBytes()); + // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 + return out.toString(StrConst.DEFAULT_CHARSET_NAME); + } } /** * 字符串的解压 * * @param str 对字符串解压 + * * @return 返回解压缩后的字符串 + * * @throws IOException */ public static String unCompress(String str) throws IOException { if (null == str || str.length() <= 0) { return str; } - // 创建一个新的 byte 数组输出流 - ByteArrayOutputStream out = new ByteArrayOutputStream(); - // 创建一个 ByteArrayInputStream,使用 buf 作为其缓冲区数组 - ByteArrayInputStream in = new ByteArrayInputStream(str - .getBytes("UTF-8")); - // 使用默认缓冲区大小创建新的输入流 - GZIPInputStream gzip = new GZIPInputStream(in); - byte[] buffer = new byte[256]; - int n = 0; - while ((n = gzip.read(buffer)) >= 0) {// 将未压缩数据读入字节数组 - // 将指定 byte 数组中从偏移量 off 开始的 len 个字节写入此 byte数组输出流 - out.write(buffer, 0, n); + try ( + // 创建一个新的 byte 数组输出流 + ByteArrayOutputStream out = new ByteArrayOutputStream(); + // 创建一个 ByteArrayInputStream,使用 buf 作为其缓冲区数组 + ByteArrayInputStream in = new ByteArrayInputStream(str.getBytes(StrConst.DEFAULT_CHARSET_NAME)); + // 使用默认缓冲区大小创建新的输入流 + GZIPInputStream gzip = new GZIPInputStream(in);) { + byte[] buffer = new byte[256]; + int n = 0; + // 将未压缩数据读入字节数组 + while ((n = gzip.read(buffer)) >= 0) { + // 将指定 byte 数组中从偏移量 off 开始的 len 个字节写入此 byte数组输出流 + out.write(buffer, 0, n); + } + // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 + return out.toString(StrConst.DEFAULT_CHARSET_NAME); } - // 使用指定的 charsetName,通过解码字节将缓冲区内容转换为字符串 - return out.toString("UTF-8"); } } diff --git a/common/src/main/java/pro/tools/file/ToolFile.java b/common/src/main/java/pro/tools/file/ToolFile.java index 480db42..0eb71d9 100644 --- a/common/src/main/java/pro/tools/file/ToolFile.java +++ b/common/src/main/java/pro/tools/file/ToolFile.java @@ -5,19 +5,7 @@ import pro.tools.data.text.ToolConvert; import pro.tools.data.text.ToolStr; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; +import java.io.*; import java.nio.charset.Charset; import java.security.DigestInputStream; import java.security.MessageDigest; @@ -1107,7 +1095,8 @@ public static String readFile2String(File file, String charsetName) throws IOExc String line; while ((line = reader.readLine()) != null) { - sb.append(line).append("\r\n");// windows系统换行为\r\n,Linux为\n + // windows系统换行为\r\n,Linux为\n + sb.append(line).append("\r\n"); } // 要去除最后的换行符 return sb.delete(sb.length() - 2, sb.length()).toString(); diff --git a/common/src/main/java/pro/tools/system/ToolOS.java b/common/src/main/java/pro/tools/system/ToolOS.java index 24a2a25..2fa067f 100644 --- a/common/src/main/java/pro/tools/system/ToolOS.java +++ b/common/src/main/java/pro/tools/system/ToolOS.java @@ -43,10 +43,14 @@ public final class ToolOS { public static final String USER_NAME = getOsSystemProperty("user.name"); // 用户的账户名称 public static final String USER_HOME = getOsSystemProperty("user.home"); // 用户的主目录 public static final String USER_DIR = getOsSystemProperty("user.dir"); // 用户的当前工作目录 - // 系统bean + /** + * 系统Bean + */ private static final OperatingSystemMXBean SYSTEM_MX_BEAN; private static final List LIST; - // K转换M + /** + * K转换M + */ private static final long K2M = 1024L * 1024L; static { diff --git a/common/src/main/java/pro/tools/time/DatePlus.java b/common/src/main/java/pro/tools/time/DatePlus.java index 5a8eb1a..f1b8dcb 100644 --- a/common/src/main/java/pro/tools/time/DatePlus.java +++ b/common/src/main/java/pro/tools/time/DatePlus.java @@ -1,11 +1,7 @@ package pro.tools.time; import java.io.Serializable; -import java.time.DayOfWeek; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.Month; +import java.time.*; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.temporal.ChronoUnit; @@ -24,6 +20,7 @@ public class DatePlus implements Serializable, Cloneable { private LocalDateTime localDateTime; //region 初始化区域 + public DatePlus() { this.localDateTime = LocalDateTime.now(); } @@ -82,6 +79,7 @@ public DatePlus(String dateStr, DateTimeFormatter dateTimeFormatter) { } //region 添加属性值 + public DatePlus addYear(long year) { this.localDateTime = this.localDateTime.plusYears(year); return this; @@ -291,6 +289,7 @@ public boolean isLeapYear() { } //region 属性的比较 + public boolean isBefore(DatePlus datePlus, DateType dateType) { boolean isBefore; switch (dateType) { @@ -346,7 +345,6 @@ public boolean isSame(DatePlus datePlus, DateType dateType) { break; } return isSame; - //return this.localDateTime.isEqual(datePlus.getLocalDateTime()); } public boolean isAfter(DatePlus datePlus, DateType dateType) { @@ -375,7 +373,6 @@ public boolean isAfter(DatePlus datePlus, DateType dateType) { break; } return isAfter; - //return this.localDateTime.isAfter(datePlus.getLocalDateTime()); } public long ofYear(DatePlus datePlus) { @@ -409,6 +406,7 @@ public long ofNanos(DatePlus datePlus) { public long ofDateTime(ChronoUnit chronoUnit, DatePlus datePlus) { return -chronoUnit.between(this.localDateTime, datePlus.localDateTime); } + //endregion @@ -543,9 +541,17 @@ public String toString() { //region 生肖和星座 + + /** + * 生肖 + */ private static final String[] CHINESE_ZODIAC = {"猴", "鸡", "狗", "猪", "鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊"}; + /** + * 星座 + */ private static final String[] ZODIAC = {"水瓶座", "双鱼座", "白羊座", "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座", "魔羯座"}; private static final int[] ZODIAC_FLAGS = {20, 19, 21, 21, 21, 22, 23, 23, 23, 24, 23, 22}; + //endregion @Override diff --git a/mail/src/main/java/pro/tools/mail/pojo/MailSend.java b/mail/src/main/java/pro/tools/mail/pojo/MailSend.java index c2c4a50..5f0105c 100644 --- a/mail/src/main/java/pro/tools/mail/pojo/MailSend.java +++ b/mail/src/main/java/pro/tools/mail/pojo/MailSend.java @@ -9,13 +9,21 @@ */ public class MailSend implements java.io.Serializable { - //接受方邮箱地址列表 + /** + * 接受方邮箱地址列表 + */ private List toList; - //标题 + /** + * 标题 + */ private String subject; - //内容 + /** + * 内容 + */ private String content; - //附件文件列表 + /** + * 附件文件列表 + */ private List attachFiles; diff --git a/pom.xml b/pom.xml index 2402711..b1a0c97 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,11 @@ ${junit.version} test + + org.projectlombok + lombok + 1.18.6 + pom diff --git a/security/src/main/java/pro/tools/security/sm/SM2.java b/security/src/main/java/pro/tools/security/sm/SM2.java index 73c022c..3f7c594 100644 --- a/security/src/main/java/pro/tools/security/sm/SM2.java +++ b/security/src/main/java/pro/tools/security/sm/SM2.java @@ -168,8 +168,9 @@ private static byte[] KDF(byte[] Z, int klen) { byte[] last = sm3hash(Z, SM3.toByteArray(ct)); if (klen % 32 == 0) { baos.write(last); - } else + } else { baos.write(last, 0, klen % 32); + } return baos.toByteArray(); } catch (Exception e) { e.printStackTrace(); @@ -185,8 +186,9 @@ private static byte[] KDF(byte[] Z, int klen) { */ private boolean allZero(byte[] buffer) { for (byte aBuffer : buffer) { - if (aBuffer != 0) + if (aBuffer != 0) { return false; + } } return true; } @@ -219,8 +221,9 @@ public byte[] encrypt(String input, ECPoint publicKey) { BigInteger h = ecc_bc_spec.getH(); if (h != null) { ECPoint S = publicKey.multiply(h); - if (S.isInfinity()) + if (S.isInfinity()) { throw new IllegalStateException(); + } } /* 4 计算 [k]PB = (x2, y2) */ @@ -278,8 +281,9 @@ public String decrypt(byte[] encryptData, BigInteger privateKey) { BigInteger h = ecc_bc_spec.getH(); if (h != null) { ECPoint S = C1.multiply(h); - if (S.isInfinity()) + if (S.isInfinity()) { throw new IllegalStateException(); + } } /* 计算[dB]C1 = (x2, y2) */ ECPoint dBC1 = C1.multiply(privateKey).normalize(); @@ -392,8 +396,9 @@ public SM2KeyPair generateKeyPair() { public void exportPublicKey(ECPoint publicKey, String path) { File file = new File(path); try { - if (!file.exists()) + if (!file.exists()) { file.createNewFile(); + } byte buffer[] = publicKey.getEncoded(false); FileOutputStream fos = new FileOutputStream(file); fos.write(buffer); @@ -412,8 +417,9 @@ public void exportPublicKey(ECPoint publicKey, String path) { public ECPoint importPublicKey(String path) { File file = new File(path); try { - if (!file.exists()) + if (!file.exists()) { return null; + } FileInputStream fis = new FileInputStream(file); ByteArrayOutputStream baos = new ByteArrayOutputStream(); @@ -439,8 +445,9 @@ public ECPoint importPublicKey(String path) { public void exportPrivateKey(BigInteger privateKey, String path) { File file = new File(path); try { - if (!file.exists()) + if (!file.exists()) { file.createNewFile(); + } ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)); oos.writeObject(privateKey); oos.close(); @@ -458,8 +465,9 @@ public void exportPrivateKey(BigInteger privateKey, String path) { public BigInteger importPrivateKey(String path) { File file = new File(path); try { - if (!file.exists()) + if (!file.exists()) { return null; + } FileInputStream fis = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(fis); BigInteger res = (BigInteger) (ois.readObject()); @@ -513,31 +521,35 @@ public Signature sign(String M, String IDA, SM2KeyPair keyPair) { * @return true or false */ public boolean verify(String M, Signature signature, String IDA, ECPoint aPublicKey) { - if (!between(signature.r, BigInteger.ONE, n)) + if (!between(signature.r, BigInteger.ONE, n)) { return false; - if (!between(signature.s, BigInteger.ONE, n)) + } + if (!between(signature.s, BigInteger.ONE, n)) { return false; + } byte[] M_ = join(ZA(IDA, aPublicKey), M.getBytes()); BigInteger e = new BigInteger(1, sm3hash(M_)); BigInteger t = signature.r.add(signature.s).mod(n); - if (t.equals(BigInteger.ZERO)) + if (t.equals(BigInteger.ZERO)) { return false; + } ECPoint p1 = G.multiply(signature.s).normalize(); ECPoint p2 = aPublicKey.multiply(t).normalize(); BigInteger x1 = p1.add(p2).normalize().getXCoord().toBigInteger(); BigInteger R = e.add(x1).mod(n); - if (R.equals(signature.r)) + if (R.equals(signature.r)) { return true; + } return false; } /** * 传输实体类 * - * @author Potato + * @author SeanDragon */ private static class TransportEntity implements Serializable { final byte[] R; //R点 @@ -556,7 +568,7 @@ public TransportEntity(byte[] r, byte[] s, byte[] z, ECPoint pKey) { /** * 密钥协商辅助类 * - * @author Potato + * @author SeanDragon */ public static class KeyExchange { BigInteger rA; @@ -614,8 +626,9 @@ public TransportEntity keyExchange_2(TransportEntity entity) { ECPoint aPublicKey = curve.decodePoint(entity.K).normalize(); ECPoint temp = aPublicKey.add(RA.multiply(x1).normalize()).normalize(); ECPoint V = temp.multiply(ecc_bc_spec.getH().multiply(tB)).normalize(); - if (V.isInfinity()) + if (V.isInfinity()) { throw new IllegalStateException(); + } this.V = V; byte[] xV = V.getXCoord().toBigInteger().toByteArray(); @@ -649,8 +662,9 @@ public TransportEntity keyExchange_3(TransportEntity entity) { ECPoint bPublicKey = curve.decodePoint(entity.K).normalize(); ECPoint temp = bPublicKey.add(RB.multiply(x2).normalize()).normalize(); ECPoint U = temp.multiply(ecc_bc_spec.getH().multiply(tA)).normalize(); - if (U.isInfinity()) + if (U.isInfinity()) { throw new IllegalStateException(); + } this.V = U; byte[] xU = U.getXCoord().toBigInteger().toByteArray(); @@ -664,10 +678,11 @@ public TransportEntity keyExchange_3(TransportEntity entity) { sm3hash(xU, this.Z, entity.Z, RA.getXCoord().toBigInteger().toByteArray(), RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(), RB.getYCoord().toBigInteger().toByteArray())); - if (Arrays.equals(entity.S, s1)) + if (Arrays.equals(entity.S, s1)) { System.out.println("B->A 密钥确认成功"); - else + } else { System.out.println("B->A 密钥确认失败"); + } byte[] sA = sm3hash(new byte[]{0x03}, yU, sm3hash(xU, this.Z, entity.Z, RA.getXCoord().toBigInteger().toByteArray(), RA.getYCoord().toBigInteger().toByteArray(), RB.getXCoord().toBigInteger().toByteArray(), @@ -689,10 +704,11 @@ public void keyExchange_4(TransportEntity entity) { sm3hash(xV, entity.Z, this.Z, RA.getXCoord().toBigInteger().toByteArray(), RA.getYCoord().toBigInteger().toByteArray(), this.RA.getXCoord().toBigInteger().toByteArray(), this.RA.getYCoord().toBigInteger().toByteArray())); - if (Arrays.equals(entity.S, s2)) + if (Arrays.equals(entity.S, s2)) { System.out.println("A->B 密钥确认成功"); - else + } else { System.out.println("A->B 密钥确认失败"); + } } } @@ -705,6 +721,7 @@ public static class Signature { this.s = s; } + @Override public String toString() { return r.toString(16) + "," + s.toString(16); } diff --git a/security/src/main/java/pro/tools/security/sm/SM3.java b/security/src/main/java/pro/tools/security/sm/SM3.java index f5bd0a0..471a646 100644 --- a/security/src/main/java/pro/tools/security/sm/SM3.java +++ b/security/src/main/java/pro/tools/security/sm/SM3.java @@ -8,7 +8,7 @@ /** * SM3杂凑算法实现 * - * @author Potato + * @author SeanDragon */ public class SM3 { @@ -47,9 +47,9 @@ private static Integer FF(Integer x, Integer y, Integer z, int j) { private static Integer GG(Integer x, Integer y, Integer z, int j) { if (j >= 0 && j <= 15) { return x ^ y ^ z; - } else if (j >= 16 && j <= 63) return (x & y) - | (~x & z); - else { + } else if (j >= 16 && j <= 63) { + return (x & y) | (~x & z); + } else { throw new RuntimeException("data invalid"); } } @@ -189,8 +189,9 @@ static byte[] toByteArray(int i) { private static String byteToHexString(byte b) { int n = b; - if (n < 0) + if (n < 0) { n = 256 + n; + } int d1 = n / 16; int d2 = n % 16; return "" + hexDigits[d1] + hexDigits[d2]; From ac3e82d85e895f4ed923b7063dc79060ef0673bd Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Sat, 3 Aug 2019 22:23:59 +0800 Subject: [PATCH 53/69] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 4036fc6..67d3998 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,6 @@ 历经开发周期两年,并且应用过千万级别项目的工具箱 -我也吸收了[https://www.v2ex.com/t/423700](https://www.v2ex.com/t/423700)该贴中v友对我的建议和意见,项目和我都会变得更好,谢谢大家 - 大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 ## 开发计划 @@ -46,4 +44,4 @@ ### security * 封装了 jdk 和 bouncycastle 中几十种常见加密方式 ### all -* 如果需要使用上述多个模块,可以导入all模块以使用所有模块 \ No newline at end of file +* 如果需要使用上述多个模块,可以导入all模块以使用所有模块 From fd592c827a741cab1cbe722491187b1494959058 Mon Sep 17 00:00:00 2001 From: SeanDragon Date: Mon, 30 Nov 2020 13:50:41 +0800 Subject: [PATCH 54/69] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..5039140 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '19 22 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From a232d9729c353caa3bab6bda3579a4c52e679f8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 22:00:52 +0000 Subject: [PATCH 55/69] Bump guava from 23.5-jre to 24.1.1-jre in /common Bumps [guava](https://github.com/google/guava) from 23.5-jre to 24.1.1-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) Signed-off-by: dependabot[bot] --- common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pom.xml b/common/pom.xml index 5e6b18b..1a7fb11 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -96,7 +96,7 @@ 2.5.1 3.3.1 2.8.2 - 23.5-jre + 24.1.1-jre 1.7.9 From 3f03c30303d56069e7213eda7d5d4252f523b61c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jun 2020 19:40:12 +0000 Subject: [PATCH 56/69] Bump netty.version from 4.1.17.Final to 4.1.50.Final in /http Bumps `netty.version` from 4.1.17.Final to 4.1.50.Final. Updates `netty-handler` from 4.1.17.Final to 4.1.50.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.17.Final...netty-4.1.50.Final) Updates `netty-codec-http` from 4.1.17.Final to 4.1.50.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.17.Final...netty-4.1.50.Final) Signed-off-by: dependabot[bot] --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 4a51313..86f8853 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -53,7 +53,7 @@ - 4.1.17.Final + 4.1.50.Final 1.9.40 3.9.0 From efe487acdd757cac67c7c8c7af90ce7ef922e873 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Nov 2020 07:59:14 +0000 Subject: [PATCH 57/69] Bump junit from 4.12 to 4.13.1 Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md) - [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1) Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b1a0c97..4a4a4e7 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 1.8 1.8 - 4.12 + 4.13.1 3.6.1 3.0.1 From 35a55a91b528a14535a6ef7b79787f841bb2057e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Feb 2021 21:25:30 +0000 Subject: [PATCH 58/69] Bump netty.version from 4.1.50.Final to 4.1.59.Final in /http Bumps `netty.version` from 4.1.50.Final to 4.1.59.Final. Updates `netty-handler` from 4.1.50.Final to 4.1.59.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.50.Final...netty-4.1.59.Final) Updates `netty-codec-http` from 4.1.50.Final to 4.1.59.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.50.Final...netty-4.1.59.Final) Signed-off-by: dependabot[bot] --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 86f8853..06cda77 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -53,7 +53,7 @@ - 4.1.50.Final + 4.1.59.Final 1.9.40 3.9.0 From 6a63d7b658db9a02627f93d683b30d7f8d9c6c7f Mon Sep 17 00:00:00 2001 From: SeanDragon <14216253+SeanDragon@users.noreply.github.com> Date: Tue, 9 Mar 2021 16:53:36 +0800 Subject: [PATCH 59/69] Update README.md --- README.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 67d3998..5af9440 100644 --- a/README.md +++ b/README.md @@ -4,20 +4,38 @@ [![License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/SeanDragon/protools/blob/master/LICENSE) [![JDK 1.8](https://img.shields.io/badge/JDK-1.8-blue.svg)](#protools) -[![GitHub stars](https://img.shields.io/github/stars/SeanDragon/protools.svg?style=flat&label=Star)](https://github.com/SeanDragon/protools/stargazers) -[![GitHub forks](https://img.shields.io/github/forks/SeanDragon/protools.svg?style=flat&label=Fork)](https://github.com/SeanDragon/protools/fork) -[![GitHub watchers](https://img.shields.io/github/watchers/SeanDragon/protools.svg?style=flat&label=Watch)](https://github.com/SeanDragon/protools/watchers) +[![GitHub Forks](https://img.shields.io/github/forks/SeanDragon/protools.svg?style=flat&label=Fork)](https://github.com/SeanDragon/protools/fork) +[![GitHub Watchers](https://img.shields.io/github/watchers/SeanDragon/protools.svg?style=flat&label=Watch)](https://github.com/SeanDragon/protools/watchers) -[![Stargazers over time](https://starcharts.herokuapp.com/SeanDragon/protools.svg)](https://starcharts.herokuapp.com/SeanDragon/protools) + + + + + + + + + + + + + + + + +
+ +[![Stargazers Over Time](https://starcharts.herokuapp.com/SeanDragon/protools.svg)](https://starcharts.herokuapp.com/SeanDragon/protools) 历经开发周期两年,并且应用过千万级别项目的工具箱 -大家如果想使用可以先执行mvn clean install即可在本地的其他maven项目中使用 +大家如果想使用可以先执行 `mvn clean install` 即可在本地的其他 `maven` 项目中使用 ## 开发计划 - 使用阿里的规范手册整理规范所有代码 - 将当时临时添加或欠缺考虑的命名或方法进行优化 - 将maven私人仓库转移到中心仓库 +- 即将进行大升级,`Gradle` + `java module` ## 目录 From 42cfa68bf0a129036ce2b078d7e596b864a24911 Mon Sep 17 00:00:00 2001 From: SeanDragon <14216253+SeanDragon@users.noreply.github.com> Date: Tue, 9 Mar 2021 17:00:24 +0800 Subject: [PATCH 60/69] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5af9440..3231ac7 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ - + From c40865d3ede7061e2ec47e024d7c69a996dae6de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Mar 2021 22:21:18 +0000 Subject: [PATCH 61/69] Bump guava from 24.1.1-jre to 29.0-jre in /common Bumps [guava](https://github.com/google/guava) from 24.1.1-jre to 29.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) Signed-off-by: dependabot[bot] --- common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pom.xml b/common/pom.xml index 1a7fb11..b05f9ba 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -96,7 +96,7 @@ 2.5.1 3.3.1 2.8.2 - 24.1.1-jre + 29.0-jre 1.7.9 From 87f132cc3b9901d90c0c944f07bba0cd502ebfef Mon Sep 17 00:00:00 2001 From: SeanDragon <14216253+SeanDragon@users.noreply.github.com> Date: Wed, 21 Jul 2021 14:30:18 +0800 Subject: [PATCH 62/69] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 3231ac7..b6167b8 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,8 @@ * 封装了 jdk 和 bouncycastle 中几十种常见加密方式 ### all * 如果需要使用上述多个模块,可以导入all模块以使用所有模块 + + +### 感谢 + - 感谢 **JetBrains** 对开源项目的支持
+![输入图片说明](https://images.gitee.com/uploads/images/2020/0714/114152_d335c2f1_416720.png "jetbrains.png") From 20b7447537b0b3b90f79a340ae5aaedea9f46637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 May 2022 21:56:46 +0000 Subject: [PATCH 63/69] Bump gson from 2.8.2 to 2.8.9 in /common Bumps [gson](https://github.com/google/gson) from 2.8.2 to 2.8.9. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.8.2...gson-parent-2.8.9) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pom.xml b/common/pom.xml index b05f9ba..e1fa247 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -95,7 +95,7 @@ 1.9.6 2.5.1 3.3.1 - 2.8.2 + 2.8.9 29.0-jre 1.7.9 From 8d3276f99e2f1fa01653d5c89b1cac823afb8d78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 00:53:42 +0000 Subject: [PATCH 64/69] Bump junrar from 1.0.1 to 7.4.1 in /common Bumps [junrar](https://github.com/junrar/junrar) from 1.0.1 to 7.4.1. - [Release notes](https://github.com/junrar/junrar/releases) - [Changelog](https://github.com/junrar/junrar/blob/master/CHANGELOG.md) - [Commits](https://github.com/junrar/junrar/compare/junrar-1.0.1...v7.4.1) --- updated-dependencies: - dependency-name: com.github.junrar:junrar dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pom.xml b/common/pom.xml index e1fa247..80accd8 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -90,7 +90,7 @@ - 1.0.1 + 7.4.1 2.56 1.9.6 2.5.1 From 097922ab4ad5848ea6de8ee81c75d4c1cab63be4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 19:27:06 +0000 Subject: [PATCH 65/69] Bump netty-codec-http from 4.1.59.Final to 4.1.71.Final in /http Bumps [netty-codec-http](https://github.com/netty/netty) from 4.1.59.Final to 4.1.71.Final. - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.59.Final...netty-4.1.71.Final) --- updated-dependencies: - dependency-name: io.netty:netty-codec-http dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 06cda77..6c96c0c 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -53,7 +53,7 @@ - 4.1.59.Final + 4.1.71.Final 1.9.40 3.9.0 From d642bf236871cfce97be2911a89088b6508b6bf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 15:23:43 +0000 Subject: [PATCH 66/69] Bump bcprov-ext-jdk15on from 1.58 to 1.67 in /security Bumps [bcprov-ext-jdk15on](https://github.com/bcgit/bc-java) from 1.58 to 1.67. - [Release notes](https://github.com/bcgit/bc-java/releases) - [Changelog](https://github.com/bcgit/bc-java/blob/master/docs/releasenotes.html) - [Commits](https://github.com/bcgit/bc-java/commits) --- updated-dependencies: - dependency-name: org.bouncycastle:bcprov-ext-jdk15on dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- security/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/pom.xml b/security/pom.xml index 9d59da3..780ce4f 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -32,6 +32,6 @@ - 1.58 + 1.67 \ No newline at end of file From 25abf0b997b8b21f6dff46152146f8217789027b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 15:48:04 +0000 Subject: [PATCH 67/69] Bump netty-codec-http from 4.1.59.Final to 4.1.77.Final in /http Bumps [netty-codec-http](https://github.com/netty/netty) from 4.1.59.Final to 4.1.77.Final. - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.59.Final...netty-4.1.77.Final) --- updated-dependencies: - dependency-name: io.netty:netty-codec-http dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 6c96c0c..2eb30a6 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -53,7 +53,7 @@ - 4.1.71.Final + 4.1.77.Final 1.9.40 3.9.0 From 2306da479db5ef9c2d6539789e9b2360cf18d164 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 21:44:25 +0000 Subject: [PATCH 68/69] Bump netty-codec-http from 4.1.77.Final to 4.1.86.Final in /http Bumps [netty-codec-http](https://github.com/netty/netty) from 4.1.77.Final to 4.1.86.Final. - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.1.77.Final...netty-4.1.86.Final) --- updated-dependencies: - dependency-name: io.netty:netty-codec-http dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- http/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http/pom.xml b/http/pom.xml index 2eb30a6..ef10db8 100644 --- a/http/pom.xml +++ b/http/pom.xml @@ -53,7 +53,7 @@ - 4.1.77.Final + 4.1.86.Final 1.9.40 3.9.0 From b7fef603c58df38955f99a4c0db12af9aa28f94a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Jun 2023 22:31:22 +0000 Subject: [PATCH 69/69] Bump guava from 29.0-jre to 32.0.0-jre in /common Bumps [guava](https://github.com/google/guava) from 29.0-jre to 32.0.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- common/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/pom.xml b/common/pom.xml index 80accd8..edfde99 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -96,7 +96,7 @@ 2.5.1 3.3.1 2.8.9 - 29.0-jre + 32.0.0-jre 1.7.9