mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
6.x
This commit is contained in:
parent
e0ac5e9961
commit
d78219c60c
1878
CHANGELOG_5.0-5.7.md
1878
CHANGELOG_5.0-5.7.md
File diff suppressed because it is too large
Load Diff
@ -144,18 +144,18 @@ We provide the T-Shirt and Sweater with Hutool Logo, please visit the shop:
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### 🍐Gradle
|
||||
```
|
||||
implementation 'cn.hutool:hutool-all:5.8.0.M5'
|
||||
implementation 'cn.hutool:hutool-all:6.0.0.M1'
|
||||
```
|
||||
|
||||
## 📥Download
|
||||
|
||||
- [Maven Repo](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.0.M5/)
|
||||
- [Maven Repo](https://repo1.maven.org/maven2/cn/hutool/hutool-all/6.0.0.M1/)
|
||||
|
||||
> 🔔️note:
|
||||
> Hutool 5.x supports JDK8+ and is not tested on Android platforms, and cannot guarantee that all tool classes or tool methods are available.
|
||||
|
@ -144,20 +144,20 @@ Hutool的存在就是为了减少代码搜索成本,避免网络上参差不
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
### 🍐Gradle
|
||||
```
|
||||
implementation 'cn.hutool:hutool-all:5.8.0.M5'
|
||||
implementation 'cn.hutool:hutool-all:6.0.0.M1'
|
||||
```
|
||||
|
||||
### 📥下载jar
|
||||
|
||||
点击以下链接,下载`hutool-all-X.X.X.jar`即可:
|
||||
|
||||
- [Maven中央库](https://repo1.maven.org/maven2/cn/hutool/hutool-all/5.8.0.M5/)
|
||||
- [Maven中央库](https://repo1.maven.org/maven2/cn/hutool/hutool-all/6.0.0.M1/)
|
||||
|
||||
> 🔔️注意
|
||||
> Hutool 5.x支持JDK8+,对Android平台没有测试,不能保证所有工具类或工具方法可用。
|
||||
|
@ -1 +1 @@
|
||||
5.8.0.M5
|
||||
6.0.0.M1
|
||||
|
@ -1 +1 @@
|
||||
var version = '5.8.0.M5'
|
||||
var version = '6.0.0.M1'
|
@ -9,12 +9,12 @@
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。</description>
|
||||
<description>Hutool是一个优雅而小巧的Java工具类库</description>
|
||||
<url>https://github.com/looly/hutool</url>
|
||||
|
||||
<dependencies>
|
||||
@ -23,21 +23,6 @@
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-aop</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-bloomFilter</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cache</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
@ -48,11 +33,6 @@
|
||||
<artifactId>hutool-db</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-dfa</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-extra</artifactId>
|
||||
@ -68,21 +48,11 @@
|
||||
<artifactId>hutool-log</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-script</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-setting</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-system</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cron</artifactId>
|
||||
@ -98,11 +68,6 @@
|
||||
<artifactId>hutool-poi</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-captcha</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-socket</artifactId>
|
||||
@ -110,7 +75,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-jwt</artifactId>
|
||||
<artifactId>hutool-swing</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -1,46 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-aop</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Hutool 动态代理(AOP)</description>
|
||||
|
||||
<properties>
|
||||
<!-- versions -->
|
||||
<cglib.version>3.3.0</cglib.version>
|
||||
<spring.version>5.3.19</spring.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>${cglib.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -1,3 +0,0 @@
|
||||
cn.hutool.aop.proxy.CglibProxyFactory
|
||||
cn.hutool.aop.proxy.SpringCglibProxyFactory
|
||||
cn.hutool.aop.proxy.JdkProxyFactory
|
@ -1,26 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-bloomFilter</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Hutool 布隆过滤器</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-bom</artifactId>
|
||||
@ -24,21 +24,6 @@
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-aop</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-bloomFilter</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cache</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
@ -49,11 +34,6 @@
|
||||
<artifactId>hutool-db</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-dfa</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-extra</artifactId>
|
||||
@ -69,21 +49,11 @@
|
||||
<artifactId>hutool-log</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-script</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-setting</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-system</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cron</artifactId>
|
||||
@ -99,11 +69,6 @@
|
||||
<artifactId>hutool-poi</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-captcha</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-socket</artifactId>
|
||||
@ -111,7 +76,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-jwt</artifactId>
|
||||
<artifactId>hutool-swing</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@ -122,18 +87,6 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-bloomFilter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
@ -142,10 +95,6 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-db</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-dfa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-extra</artifactId>
|
||||
@ -158,18 +107,10 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-log</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-script</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-setting</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-cron</artifactId>
|
||||
@ -182,17 +123,13 @@
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-poi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-captcha</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-socket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-jwt</artifactId>
|
||||
<artifactId>hutool-swing</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-cache</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Hutool 缓存</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-core</artifactId>
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.cache.impl.CacheObj;
|
||||
import cn.hutool.core.cache.impl.CacheObj;
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
|
||||
import java.io.Serializable;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
/**
|
||||
* 缓存监听,用于实现缓存操作时的回调监听,例如缓存对象的移除事件等
|
@ -1,11 +1,11 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.cache.impl.FIFOCache;
|
||||
import cn.hutool.cache.impl.LFUCache;
|
||||
import cn.hutool.cache.impl.LRUCache;
|
||||
import cn.hutool.cache.impl.NoCache;
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import cn.hutool.cache.impl.WeakCache;
|
||||
import cn.hutool.core.cache.impl.FIFOCache;
|
||||
import cn.hutool.core.cache.impl.LFUCache;
|
||||
import cn.hutool.core.cache.impl.LRUCache;
|
||||
import cn.hutool.core.cache.impl.NoCache;
|
||||
import cn.hutool.core.cache.impl.TimedCache;
|
||||
import cn.hutool.core.cache.impl.WeakCache;
|
||||
|
||||
/**
|
||||
* 缓存工具类
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
@ -1,12 +1,12 @@
|
||||
package cn.hutool.cache.file;
|
||||
package cn.hutool.core.cache.file;
|
||||
|
||||
import cn.hutool.core.cache.Cache;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
|
||||
/**
|
||||
* 文件缓存,以解决频繁读取文件引起的性能问题
|
||||
* @author Looly
|
@ -1,10 +1,10 @@
|
||||
package cn.hutool.cache.file;
|
||||
package cn.hutool.core.cache.file;
|
||||
|
||||
import cn.hutool.core.cache.Cache;
|
||||
import cn.hutool.core.cache.impl.LFUCache;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.cache.impl.LFUCache;
|
||||
|
||||
/**
|
||||
* 使用LFU缓存文件,以解决频繁读取文件引起的性能问题
|
||||
* @author Looly
|
@ -1,10 +1,10 @@
|
||||
package cn.hutool.cache.file;
|
||||
package cn.hutool.core.cache.file;
|
||||
|
||||
import cn.hutool.core.cache.Cache;
|
||||
import cn.hutool.core.cache.impl.LRUCache;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.cache.impl.LRUCache;
|
||||
|
||||
/**
|
||||
* 使用LRU缓存文件,以解决频繁读取文件引起的性能问题
|
||||
* @author Looly
|
@ -4,4 +4,4 @@
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.cache.file;
|
||||
package cn.hutool.core.cache.file;
|
@ -1,7 +1,7 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.cache.CacheListener;
|
||||
import cn.hutool.core.cache.Cache;
|
||||
import cn.hutool.core.cache.CacheListener;
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
import cn.hutool.core.lang.mutable.Mutable;
|
||||
import cn.hutool.core.lang.mutable.MutableObj;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* {@link cn.hutool.cache.impl.AbstractCache} 的CacheObj迭代器.
|
||||
* {@link AbstractCache} 的CacheObj迭代器.
|
||||
*
|
||||
* @author looly
|
||||
*
|
@ -1,10 +1,10 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* {@link cn.hutool.cache.impl.AbstractCache} 的值迭代器.
|
||||
* {@link AbstractCache} 的值迭代器.
|
||||
* @author looly
|
||||
*
|
||||
* @param <V> 迭代对象类型
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.core.map.FixedLinkedHashMap;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.core.cache.Cache;
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
|
||||
import java.util.Iterator;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.core.collection.CopiedIter;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.core.collection.CopiedIter;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.cache.GlobalPruneTimer;
|
||||
import cn.hutool.core.cache.GlobalPruneTimer;
|
||||
import cn.hutool.core.lang.mutable.Mutable;
|
||||
|
||||
import java.util.HashMap;
|
4
hutool-cache/src/main/java/cn/hutool/cache/impl/WeakCache.java → hutool-core/src/main/java/cn/hutool/core/cache/impl/WeakCache.java
vendored
Executable file → Normal file
4
hutool-cache/src/main/java/cn/hutool/cache/impl/WeakCache.java → hutool-core/src/main/java/cn/hutool/core/cache/impl/WeakCache.java
vendored
Executable file → Normal file
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
||||
|
||||
import cn.hutool.cache.CacheListener;
|
||||
import cn.hutool.core.cache.CacheListener;
|
||||
import cn.hutool.core.lang.Opt;
|
||||
import cn.hutool.core.lang.mutable.Mutable;
|
||||
import cn.hutool.core.map.WeakConcurrentMap;
|
@ -4,4 +4,4 @@
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.cache.impl;
|
||||
package cn.hutool.core.cache.impl;
|
@ -4,4 +4,4 @@
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
@ -1,7 +1,10 @@
|
||||
package cn.hutool.core.util;
|
||||
package cn.hutool.core.codec;
|
||||
|
||||
import cn.hutool.core.codec.Base16Codec;
|
||||
import cn.hutool.core.exceptions.UtilException;
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.math.BigInteger;
|
@ -2,7 +2,6 @@ package cn.hutool.core.codec;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -10,7 +10,7 @@ import cn.hutool.core.util.ByteUtil;
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.ClassUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* GIF处理,来自:https://github.com/rtyley/animated-gif-lib-for-java
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.core.img.gif;
|
@ -7,7 +7,7 @@ import cn.hutool.core.io.copy.ReaderWriterCopier;
|
||||
import cn.hutool.core.io.copy.StreamCopier;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.core.io.checksum.crc16;
|
||||
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.bitMap;
|
||||
package cn.hutool.core.map.bitMap;
|
||||
|
||||
/**
|
||||
* BitMap接口,用于将某个int或long值映射到一个数组中,从而判定某个值是否存在
|
||||
@ -32,4 +32,4 @@ public interface BitMap{
|
||||
* @param i 值
|
||||
*/
|
||||
void remove(long i);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.bitMap;
|
||||
package cn.hutool.core.map.bitMap;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.bitMap;
|
||||
package cn.hutool.core.map.bitMap;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -4,4 +4,4 @@
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.bloomfilter.bitMap;
|
||||
package cn.hutool.core.map.bitMap;
|
@ -1,7 +1,7 @@
|
||||
package cn.hutool.core.net;
|
||||
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.hutool.core.text;
|
||||
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
|
@ -1,10 +1,10 @@
|
||||
package cn.hutool.bloomfilter;
|
||||
package cn.hutool.core.text.bloomfilter;
|
||||
|
||||
import cn.hutool.bloomfilter.filter.DefaultFilter;
|
||||
import cn.hutool.bloomfilter.filter.ELFFilter;
|
||||
import cn.hutool.bloomfilter.filter.JSFilter;
|
||||
import cn.hutool.bloomfilter.filter.PJWFilter;
|
||||
import cn.hutool.bloomfilter.filter.SDBMFilter;
|
||||
import cn.hutool.core.text.bloomfilter.filter.DefaultFilter;
|
||||
import cn.hutool.core.text.bloomfilter.filter.ELFFilter;
|
||||
import cn.hutool.core.text.bloomfilter.filter.JSFilter;
|
||||
import cn.hutool.core.text.bloomfilter.filter.PJWFilter;
|
||||
import cn.hutool.core.text.bloomfilter.filter.SDBMFilter;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
|
||||
/**
|
||||
@ -79,4 +79,4 @@ public class BitMapBloomFilter implements BloomFilter {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter;
|
||||
package cn.hutool.core.text.bloomfilter;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter;
|
||||
package cn.hutool.core.text.bloomfilter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter;
|
||||
package cn.hutool.core.text.bloomfilter;
|
||||
|
||||
/**
|
||||
* 布隆过滤器工具
|
@ -1,9 +1,9 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.bloomfilter.BloomFilter;
|
||||
import cn.hutool.bloomfilter.bitMap.BitMap;
|
||||
import cn.hutool.bloomfilter.bitMap.IntMap;
|
||||
import cn.hutool.bloomfilter.bitMap.LongMap;
|
||||
import cn.hutool.core.map.bitMap.BitMap;
|
||||
import cn.hutool.core.map.bitMap.IntMap;
|
||||
import cn.hutool.core.map.bitMap.LongMap;
|
||||
import cn.hutool.core.text.bloomfilter.BloomFilter;
|
||||
|
||||
/**
|
||||
* 抽象Bloom过滤器
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.bloomfilter.BloomFilter;
|
||||
import cn.hutool.core.text.bloomfilter.BloomFilter;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
||||
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
|
@ -4,4 +4,4 @@
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.bloomfilter.filter;
|
||||
package cn.hutool.core.text.bloomfilter.filter;
|
@ -4,4 +4,4 @@
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.bloomfilter;
|
||||
package cn.hutool.core.text.bloomfilter;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
import cn.hutool.core.lang.DefaultSegment;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
/**
|
||||
* @author 肖海斌
|
@ -1,10 +1,9 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Filter;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@ -102,16 +101,6 @@ public final class SensitiveUtil {
|
||||
return sensitiveTree.isMatch(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否包含敏感词
|
||||
*
|
||||
* @param obj bean,会被转为JSON字符串
|
||||
* @return 是否包含
|
||||
*/
|
||||
public static boolean containsSensitive(Object obj) {
|
||||
return sensitiveTree.isMatch(JSONUtil.toJsonStr(obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找敏感词,返回找到的第一个敏感词
|
||||
*
|
||||
@ -123,16 +112,6 @@ public final class SensitiveUtil {
|
||||
return sensitiveTree.matchWord(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找敏感词,返回找到的第一个敏感词
|
||||
*
|
||||
* @param obj bean,会被转为JSON字符串
|
||||
* @return 敏感词
|
||||
*/
|
||||
public static FoundWord getFoundFirstSensitive(Object obj) {
|
||||
return sensitiveTree.matchWord(JSONUtil.toJsonStr(obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找敏感词,返回找到的所有敏感词
|
||||
*
|
||||
@ -158,47 +137,6 @@ public final class SensitiveUtil {
|
||||
return sensitiveTree.matchAllWords(text, -1, isDensityMatch, isGreedMatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找敏感词,返回找到的所有敏感词
|
||||
*
|
||||
* @param bean 对象,会被转为JSON
|
||||
* @return 敏感词
|
||||
* @since 5.5.3
|
||||
*/
|
||||
public static List<FoundWord> getFoundAllSensitive(Object bean) {
|
||||
return sensitiveTree.matchAllWords(JSONUtil.toJsonStr(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找敏感词,返回找到的所有敏感词<br>
|
||||
* 密集匹配原则:假如关键词有 ab,b,文本是abab,将匹配 [ab,b,ab]<br>
|
||||
* 贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab]
|
||||
*
|
||||
* @param bean 对象,会被转为JSON
|
||||
* @param isDensityMatch 是否使用密集匹配原则
|
||||
* @param isGreedMatch 是否使用贪婪匹配(最长匹配)原则
|
||||
* @return 敏感词
|
||||
* @since 5.5.3
|
||||
*/
|
||||
public static List<FoundWord> getFoundAllSensitive(Object bean, boolean isDensityMatch, boolean isGreedMatch) {
|
||||
return getFoundAllSensitive(JSONUtil.toJsonStr(bean), isDensityMatch, isGreedMatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* 敏感词过滤
|
||||
*
|
||||
* @param bean 对象,会被转为JSON
|
||||
* @param isGreedMatch 贪婪匹配(最长匹配)原则:假如关键字a,ab,最长匹配将匹配[a, ab]
|
||||
* @param sensitiveProcessor 敏感词处理器,默认按匹配内容的字符数替换成*
|
||||
* @param <T> bean的class类型
|
||||
* @return 敏感词过滤处理后的bean对象
|
||||
*/
|
||||
public static <T> T sensitiveFilter(T bean, boolean isGreedMatch, SensitiveProcessor sensitiveProcessor) {
|
||||
String jsonText = JSONUtil.toJsonStr(bean);
|
||||
@SuppressWarnings("unchecked") final Class<T> c = (Class<T>) bean.getClass();
|
||||
return JSONUtil.toBean(sensitiveFilter(jsonText, isGreedMatch, sensitiveProcessor), c);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理过滤文本中的敏感词,默认替换成*
|
||||
*
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ -6,7 +6,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
|
||||
/**
|
||||
* 过滤词及一些简单处理
|
||||
*
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
public class StopChar {
|
||||
@ -31,7 +31,7 @@ public class StopChar {
|
||||
|
||||
/**
|
||||
* 判断指定的词是否是不处理的词。 如果参数为空,则返回true,因为空也属于不处理的字符。
|
||||
*
|
||||
*
|
||||
* @param ch 指定的词
|
||||
* @return 是否是不处理的词
|
||||
*/
|
||||
@ -41,7 +41,7 @@ public class StopChar {
|
||||
|
||||
/**
|
||||
* 是否为合法字符(待处理字符)
|
||||
*
|
||||
*
|
||||
* @param ch 指定的词
|
||||
* @return 是否为合法字符(待处理字符)
|
||||
*/
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Filter;
|
@ -2,8 +2,8 @@
|
||||
* DFA全称为:Deterministic Finite Automaton,即确定有穷自动机。<br>
|
||||
* 解释起来原理其实也不难,就是用所有关键字构造一棵树,然后用正文遍历这棵树,遍历到叶子节点即表示文章中存在这个关键字。<br>
|
||||
* 我们暂且忽略构建关键词树的时间,每次查找正文只需要O(n)复杂度就可以搞定。<br>
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
@ -1,16 +1,12 @@
|
||||
package cn.hutool.core.util;
|
||||
package cn.hutool.core.text.escape;
|
||||
|
||||
import cn.hutool.core.lang.Filter;
|
||||
import cn.hutool.core.text.escape.Html4Escape;
|
||||
import cn.hutool.core.text.escape.Html4Unescape;
|
||||
import cn.hutool.core.text.escape.XmlEscape;
|
||||
import cn.hutool.core.text.escape.XmlUnescape;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
/**
|
||||
* 转义和反转义工具类Escape / Unescape<br>
|
||||
* escape采用ISO Latin字符集对指定的字符串进行编码。<br>
|
||||
* 所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进制数字)。
|
||||
* TODO 6.x迁移到core.text.escape包下
|
||||
*
|
||||
* @author xiaoleilu
|
||||
*/
|
47
hutool-script/src/main/java/cn/hutool/script/ScriptUtil.java → hutool-core/src/main/java/cn/hutool/core/util/ScriptUtil.java
Executable file → Normal file
47
hutool-script/src/main/java/cn/hutool/script/ScriptUtil.java → hutool-core/src/main/java/cn/hutool/core/util/ScriptUtil.java
Executable file → Normal file
@ -1,7 +1,7 @@
|
||||
package cn.hutool.script;
|
||||
package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.exceptions.UtilException;
|
||||
import cn.hutool.core.map.WeakConcurrentMap;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.Compilable;
|
||||
@ -53,15 +53,6 @@ public class ScriptUtil {
|
||||
return engine;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得非单例的 Javascript引擎 {@link JavaScriptEngine}
|
||||
*
|
||||
* @return {@link JavaScriptEngine}
|
||||
*/
|
||||
public static JavaScriptEngine getJavaScriptEngine() {
|
||||
return new JavaScriptEngine();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得单例的JavaScript引擎
|
||||
*
|
||||
@ -160,23 +151,23 @@ public class ScriptUtil {
|
||||
*
|
||||
* @param script 脚本内容
|
||||
* @return 执行结果
|
||||
* @throws ScriptRuntimeException 脚本异常
|
||||
* @throws UtilException 脚本异常
|
||||
* @since 5.3.6
|
||||
*/
|
||||
public static Invocable evalInvocable(String script) throws ScriptRuntimeException {
|
||||
public static Invocable evalInvocable(String script) throws UtilException {
|
||||
final ScriptEngine jsEngine = getJsEngine();
|
||||
final Object eval;
|
||||
try {
|
||||
eval = jsEngine.eval(script);
|
||||
} catch (ScriptException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
if(eval instanceof Invocable){
|
||||
return (Invocable)eval;
|
||||
} else if(jsEngine instanceof Invocable){
|
||||
return (Invocable)jsEngine;
|
||||
}
|
||||
throw new ScriptRuntimeException("Script is not invocable !");
|
||||
throw new UtilException("Script is not invocable !");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,14 +175,14 @@ public class ScriptUtil {
|
||||
*
|
||||
* @param script 脚本内容
|
||||
* @return 执行结果
|
||||
* @throws ScriptRuntimeException 脚本异常
|
||||
* @throws UtilException 脚本异常
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public static Object eval(String script) throws ScriptRuntimeException {
|
||||
public static Object eval(String script) throws UtilException {
|
||||
try {
|
||||
return getJsEngine().eval(script);
|
||||
} catch (ScriptException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,14 +192,14 @@ public class ScriptUtil {
|
||||
* @param script 脚本内容
|
||||
* @param context 脚本上下文
|
||||
* @return 执行结果
|
||||
* @throws ScriptRuntimeException 脚本异常
|
||||
* @throws UtilException 脚本异常
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public static Object eval(String script, ScriptContext context) throws ScriptRuntimeException {
|
||||
public static Object eval(String script, ScriptContext context) throws UtilException {
|
||||
try {
|
||||
return getJsEngine().eval(script, context);
|
||||
} catch (ScriptException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -218,14 +209,14 @@ public class ScriptUtil {
|
||||
* @param script 脚本内容
|
||||
* @param bindings 绑定的参数
|
||||
* @return 执行结果
|
||||
* @throws ScriptRuntimeException 脚本异常
|
||||
* @throws UtilException 脚本异常
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public static Object eval(String script, Bindings bindings) throws ScriptRuntimeException {
|
||||
public static Object eval(String script, Bindings bindings) throws UtilException {
|
||||
try {
|
||||
return getJsEngine().eval(script, bindings);
|
||||
} catch (ScriptException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -243,7 +234,7 @@ public class ScriptUtil {
|
||||
try {
|
||||
return eval.invokeFunction(func, args);
|
||||
} catch (ScriptException | NoSuchMethodException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,14 +243,14 @@ public class ScriptUtil {
|
||||
*
|
||||
* @param script 脚本内容
|
||||
* @return {@link CompiledScript}
|
||||
* @throws ScriptRuntimeException 脚本异常
|
||||
* @throws UtilException 脚本异常
|
||||
* @since 3.2.0
|
||||
*/
|
||||
public static CompiledScript compile(String script) throws ScriptRuntimeException {
|
||||
public static CompiledScript compile(String script) throws UtilException {
|
||||
try {
|
||||
return compile(getJsEngine(), script);
|
||||
} catch (ScriptException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.map.BiMap;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.text.escape.EscapeUtil;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
|
@ -1,8 +1,8 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.cache.impl.FIFOCache;
|
||||
import cn.hutool.cache.impl.LRUCache;
|
||||
import cn.hutool.cache.impl.WeakCache;
|
||||
import cn.hutool.core.cache.impl.FIFOCache;
|
||||
import cn.hutool.core.cache.impl.LRUCache;
|
||||
import cn.hutool.core.cache.impl.WeakCache;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.thread.ConcurrencyTester;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import cn.hutool.core.cache.impl.TimedCache;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
@ -1,9 +1,9 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.cache.file.LFUFileCache;
|
||||
import cn.hutool.core.cache.file.LFUFileCache;
|
||||
|
||||
/**
|
||||
* 文件缓存单元测试
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.cache.impl.LRUCache;
|
||||
import cn.hutool.core.cache.impl.LRUCache;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.junit.Assert;
|
||||
@ -10,7 +10,7 @@ import org.junit.Test;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
/**
|
||||
* 见:https://github.com/dromara/hutool/issues/1895<br>
|
||||
* 见:<a href="https://github.com/dromara/hutool/issues/1895">https://github.com/dromara/hutool/issues/1895</a><br>
|
||||
* 并发问题测试,在5.7.15前,LRUCache存在并发问题,多线程get后,map结构变更,导致null的位置不确定,
|
||||
* 并可能引起死锁。
|
||||
*/
|
4
hutool-cache/src/test/java/cn/hutool/cache/WeakCacheTest.java → hutool-core/src/test/java/cn/hutool/core/cache/WeakCacheTest.java
vendored
Executable file → Normal file
4
hutool-cache/src/test/java/cn/hutool/cache/WeakCacheTest.java → hutool-core/src/test/java/cn/hutool/core/cache/WeakCacheTest.java
vendored
Executable file → Normal file
@ -1,6 +1,6 @@
|
||||
package cn.hutool.cache;
|
||||
package cn.hutool.core.cache;
|
||||
|
||||
import cn.hutool.cache.impl.WeakCache;
|
||||
import cn.hutool.core.cache.impl.WeakCache;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
@ -6,7 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ByteUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.hutool.core.io.checksum;
|
||||
|
||||
import cn.hutool.core.io.checksum.crc16.CRC16XModem;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -2,7 +2,7 @@ package cn.hutool.core.lang.hash;
|
||||
|
||||
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.junit.Assert;
|
||||
|
@ -1,12 +1,11 @@
|
||||
package cn.hutool.bloomfilter;
|
||||
package cn.hutool.core.text.bloomfilter;
|
||||
|
||||
import cn.hutool.core.map.bitMap.IntMap;
|
||||
import cn.hutool.core.map.bitMap.LongMap;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.bloomfilter.bitMap.IntMap;
|
||||
import cn.hutool.bloomfilter.bitMap.LongMap;
|
||||
|
||||
public class BitMapBloomFilterTest {
|
||||
|
||||
@Test
|
||||
@ -23,10 +22,10 @@ public class BitMapBloomFilterTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testIntMap(){
|
||||
public void testIntMap() {
|
||||
IntMap intMap = new IntMap();
|
||||
|
||||
for (int i = 0 ; i < 32; i++) {
|
||||
for (int i = 0; i < 32; i++) {
|
||||
intMap.add(i);
|
||||
}
|
||||
intMap.remove(30);
|
||||
@ -39,10 +38,10 @@ public class BitMapBloomFilterTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testLongMap(){
|
||||
public void testLongMap() {
|
||||
LongMap longMap = new LongMap();
|
||||
|
||||
for (int i = 0 ; i < 64; i++) {
|
||||
for (int i = 0; i < 64; i++) {
|
||||
longMap.add(i);
|
||||
}
|
||||
longMap.remove(30);
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.junit.Assert;
|
@ -1,4 +1,4 @@
|
||||
package cn.hutool.dfa;
|
||||
package cn.hutool.core.text.dfa;
|
||||
|
||||
import cn.hutool.core.collection.ListUtil;
|
||||
import lombok.Data;
|
||||
@ -22,8 +22,8 @@ public class SensitiveUtilTest {
|
||||
bean.setStr("我有一颗$大土^豆,刚出锅的");
|
||||
bean.setNum(100);
|
||||
SensitiveUtil.init(wordList);
|
||||
bean = SensitiveUtil.sensitiveFilter(bean, true, null);
|
||||
Assert.assertEquals(bean.getStr(), "我有一颗$****,***的");
|
||||
String beanStr = SensitiveUtil.sensitiveFilter(bean.getStr(), true, null);
|
||||
Assert.assertEquals("我有一颗$****,***的", beanStr);
|
||||
}
|
||||
|
||||
@Data
|
@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.text.escape.EscapeUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -1,18 +1,16 @@
|
||||
package cn.hutool.script.test;
|
||||
package cn.hutool.core.util;
|
||||
|
||||
import cn.hutool.core.exceptions.UtilException;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.script.ScriptRuntimeException;
|
||||
import cn.hutool.script.ScriptUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
/**
|
||||
* 脚本单元测试类
|
||||
*
|
||||
*
|
||||
* @author looly
|
||||
*
|
||||
*/
|
||||
@ -24,7 +22,7 @@ public class ScriptUtilTest {
|
||||
try {
|
||||
script.eval();
|
||||
} catch (ScriptException e) {
|
||||
throw new ScriptRuntimeException(e);
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,22 +36,4 @@ public class ScriptUtilTest {
|
||||
final Object result = ScriptUtil.invoke(ResourceUtil.readUtf8Str("filter1.js"), "filter1", 2, 1);
|
||||
Assert.assertTrue((Boolean) result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void pythonTest() throws ScriptException {
|
||||
final ScriptEngine pythonEngine = ScriptUtil.getPythonEngine();
|
||||
pythonEngine.eval("print('Hello Python')");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void luaTest() throws ScriptException {
|
||||
final ScriptEngine engine = ScriptUtil.getLuaEngine();
|
||||
engine.eval("print('Hello Lua')");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void groovyTest() throws ScriptException {
|
||||
final ScriptEngine engine = ScriptUtil.getGroovyEngine();
|
||||
engine.eval("println 'Hello Groovy'");
|
||||
}
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-cron</artifactId>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-parent</artifactId>
|
||||
<version>5.8.0.M5</version>
|
||||
<version>6.0.0.M1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
|
@ -3,7 +3,7 @@ package cn.hutool.crypto;
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.asymmetric.AsymmetricAlgorithm;
|
||||
import cn.hutool.crypto.asymmetric.RSA;
|
||||
|
@ -5,7 +5,7 @@ import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.hutool.crypto.asymmetric;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.crypto.BCUtil;
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
import cn.hutool.crypto.ECKeyUtil;
|
||||
|
@ -4,7 +4,7 @@ import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
@ -5,7 +5,7 @@ import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
@ -22,7 +22,7 @@ import java.security.Provider;
|
||||
/**
|
||||
* 摘要算法<br>
|
||||
* 注意:此对象实例化后为非线程安全!
|
||||
*
|
||||
*
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
@ -40,7 +40,7 @@ public class Digester implements Serializable {
|
||||
// ------------------------------------------------------------------------------------------- Constructor start
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param algorithm 算法枚举
|
||||
*/
|
||||
public Digester(DigestAlgorithm algorithm) {
|
||||
@ -49,7 +49,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param algorithm 算法枚举
|
||||
*/
|
||||
public Digester(String algorithm) {
|
||||
@ -58,7 +58,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param algorithm 算法
|
||||
* @param provider 算法提供者,null表示JDK默认,可以引入Bouncy Castle等来提供更多算法支持
|
||||
* @since 4.5.1
|
||||
@ -69,7 +69,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
*
|
||||
* @param algorithm 算法
|
||||
* @param provider 算法提供者,null表示JDK默认,可以引入Bouncy Castle等来提供更多算法支持
|
||||
* @since 4.5.1
|
||||
@ -81,7 +81,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
*
|
||||
* @param algorithm 算法
|
||||
* @param provider 算法提供者,null表示JDK默认,可以引入Bouncy Castle等来提供更多算法支持
|
||||
* @return Digester
|
||||
@ -99,10 +99,10 @@ public class Digester implements Serializable {
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置加盐内容
|
||||
*
|
||||
*
|
||||
* @param salt 盐值
|
||||
* @return this
|
||||
* @since 4.4.3
|
||||
@ -115,18 +115,18 @@ public class Digester implements Serializable {
|
||||
/**
|
||||
* 设置加盐的位置,只有盐值存在时有效<br>
|
||||
* 加盐的位置指盐位于数据byte数组中的位置,例如:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* data: 0123456
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* 则当saltPosition = 2时,盐位于data的1和2中间,即第二个空隙,即:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* data: 01[salt]23456
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @param saltPosition 盐的位置
|
||||
* @return this
|
||||
* @since 4.4.3
|
||||
@ -138,7 +138,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 设置重复计算摘要值次数
|
||||
*
|
||||
*
|
||||
* @param digestCount 摘要值次数
|
||||
* @return this
|
||||
*/
|
||||
@ -149,7 +149,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 重置{@link MessageDigest}
|
||||
*
|
||||
*
|
||||
* @return this
|
||||
* @since 4.5.1
|
||||
*/
|
||||
@ -161,7 +161,7 @@ public class Digester implements Serializable {
|
||||
// ------------------------------------------------------------------------------------------- Digest
|
||||
/**
|
||||
* 生成文件摘要
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @param charsetName 编码
|
||||
* @return 摘要
|
||||
@ -169,10 +169,10 @@ public class Digester implements Serializable {
|
||||
public byte[] digest(String data, String charsetName) {
|
||||
return digest(data, CharsetUtil.charset(charsetName));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成文件摘要
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @param charset 编码
|
||||
* @return 摘要
|
||||
@ -184,7 +184,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成文件摘要
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @return 摘要
|
||||
*/
|
||||
@ -194,7 +194,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成文件摘要,并转为16进制字符串
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @param charsetName 编码
|
||||
* @return 摘要
|
||||
@ -202,10 +202,10 @@ public class Digester implements Serializable {
|
||||
public String digestHex(String data, String charsetName) {
|
||||
return digestHex(data, CharsetUtil.charset(charsetName));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成文件摘要,并转为16进制字符串
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @param charset 编码
|
||||
* @return 摘要
|
||||
@ -217,7 +217,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成文件摘要
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @return 摘要
|
||||
*/
|
||||
@ -228,7 +228,7 @@ public class Digester implements Serializable {
|
||||
/**
|
||||
* 生成文件摘要<br>
|
||||
* 使用默认缓存大小,见 {@link IoUtil#DEFAULT_BUFFER_SIZE}
|
||||
*
|
||||
*
|
||||
* @param file 被摘要文件
|
||||
* @return 摘要bytes
|
||||
* @throws CryptoException Cause by IOException
|
||||
@ -246,7 +246,7 @@ public class Digester implements Serializable {
|
||||
/**
|
||||
* 生成文件摘要,并转为16进制字符串<br>
|
||||
* 使用默认缓存大小,见 {@link IoUtil#DEFAULT_BUFFER_SIZE}
|
||||
*
|
||||
*
|
||||
* @param file 被摘要文件
|
||||
* @return 摘要
|
||||
*/
|
||||
@ -256,7 +256,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成摘要,考虑加盐和重复摘要次数
|
||||
*
|
||||
*
|
||||
* @param data 数据bytes
|
||||
* @return 摘要bytes
|
||||
*/
|
||||
@ -284,7 +284,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成摘要,并转为16进制字符串<br>
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @return 摘要
|
||||
*/
|
||||
@ -294,7 +294,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成摘要,使用默认缓存大小,见 {@link IoUtil#DEFAULT_BUFFER_SIZE}
|
||||
*
|
||||
*
|
||||
* @param data {@link InputStream} 数据流
|
||||
* @return 摘要bytes
|
||||
*/
|
||||
@ -305,7 +305,7 @@ public class Digester implements Serializable {
|
||||
/**
|
||||
* 生成摘要,并转为16进制字符串<br>
|
||||
* 使用默认缓存大小,见 {@link IoUtil#DEFAULT_BUFFER_SIZE}
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @return 摘要
|
||||
*/
|
||||
@ -315,7 +315,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成摘要
|
||||
*
|
||||
*
|
||||
* @param data {@link InputStream} 数据流
|
||||
* @param bufferLength 缓存长度,不足1使用 {@link IoUtil#DEFAULT_BUFFER_SIZE} 做为默认值
|
||||
* @return 摘要bytes
|
||||
@ -325,7 +325,7 @@ public class Digester implements Serializable {
|
||||
if (bufferLength < 1) {
|
||||
bufferLength = IoUtil.DEFAULT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
|
||||
byte[] result;
|
||||
try {
|
||||
if (ArrayUtil.isEmpty(this.salt)) {
|
||||
@ -336,14 +336,14 @@ public class Digester implements Serializable {
|
||||
} catch (IOException e) {
|
||||
throw new IORuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
return resetAndRepeatDigest(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成摘要,并转为16进制字符串<br>
|
||||
* 使用默认缓存大小,见 {@link IoUtil#DEFAULT_BUFFER_SIZE}
|
||||
*
|
||||
*
|
||||
* @param data 被摘要数据
|
||||
* @param bufferLength 缓存长度,不足1使用 {@link IoUtil#DEFAULT_BUFFER_SIZE} 做为默认值
|
||||
* @return 摘要
|
||||
@ -354,7 +354,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 获得 {@link MessageDigest}
|
||||
*
|
||||
*
|
||||
* @return {@link MessageDigest}
|
||||
*/
|
||||
public MessageDigest getDigest() {
|
||||
@ -363,7 +363,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 获取散列长度,0表示不支持此方法
|
||||
*
|
||||
*
|
||||
* @return 散列长度,0表示不支持此方法
|
||||
* @since 4.5.0
|
||||
*/
|
||||
@ -374,7 +374,7 @@ public class Digester implements Serializable {
|
||||
// -------------------------------------------------------------------------------- Private method start
|
||||
/**
|
||||
* 生成摘要
|
||||
*
|
||||
*
|
||||
* @param data {@link InputStream} 数据流
|
||||
* @param bufferLength 缓存长度,不足1使用 {@link IoUtil#DEFAULT_BUFFER_SIZE} 做为默认值
|
||||
* @return 摘要bytes
|
||||
@ -391,7 +391,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成摘要
|
||||
*
|
||||
*
|
||||
* @param data {@link InputStream} 数据流
|
||||
* @param bufferLength 缓存长度,不足1使用 {@link IoUtil#DEFAULT_BUFFER_SIZE} 做为默认值
|
||||
* @return 摘要bytes
|
||||
@ -430,7 +430,7 @@ public class Digester implements Serializable {
|
||||
|
||||
/**
|
||||
* 生成摘要
|
||||
*
|
||||
*
|
||||
* @param datas 数据bytes
|
||||
* @return 摘要bytes
|
||||
* @since 4.4.3
|
||||
@ -447,7 +447,7 @@ public class Digester implements Serializable {
|
||||
/**
|
||||
* 重复计算摘要,取决于{@link #digestCount} 值<br>
|
||||
* 每次计算摘要前都会重置{@link #digest}
|
||||
*
|
||||
*
|
||||
* @param digestData 第一次摘要过的数据
|
||||
* @return 摘要
|
||||
*/
|
||||
|
@ -4,7 +4,7 @@ import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.hutool.crypto.symmetric;
|
||||
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.crypto.KeyUtil;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
|
@ -2,7 +2,7 @@ package cn.hutool.crypto.symmetric;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
|
@ -5,7 +5,7 @@ import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.lang.Opt;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.CipherMode;
|
||||
|
@ -4,7 +4,7 @@ import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.HexUtil;
|
||||
import cn.hutool.core.codec.HexUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user