This commit is contained in:
Looly 2022-04-28 01:30:17 +08:00
parent e0ac5e9961
commit d78219c60c
248 changed files with 621 additions and 3407 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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.

View File

@ -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平台没有测试不能保证所有工具类或工具方法可用。

View File

@ -1 +1 @@
5.8.0.M5
6.0.0.M1

View File

@ -1 +1 @@
var version = '5.8.0.M5'
var version = '6.0.0.M1'

View File

@ -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>

View File

@ -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>

View File

@ -1,3 +0,0 @@
cn.hutool.aop.proxy.CglibProxyFactory
cn.hutool.aop.proxy.SpringCglibProxyFactory
cn.hutool.aop.proxy.JdkProxyFactory

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -1,4 +1,4 @@
package cn.hutool.cache;
package cn.hutool.core.cache;
/**
* 缓存监听用于实现缓存操作时的回调监听例如缓存对象的移除事件等

View File

@ -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;
/**
* 缓存工具类

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -4,4 +4,4 @@
* @author looly
*
*/
package cn.hutool.cache.file;
package cn.hutool.core.cache.file;

View 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;

View File

@ -1,4 +1,4 @@
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;
import cn.hutool.core.date.DateUtil;

View File

@ -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
*

View File

@ -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> 迭代对象类型

View File

@ -1,4 +1,4 @@
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;
import java.util.Iterator;
import java.util.LinkedHashMap;

View File

@ -1,4 +1,4 @@
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;
import java.util.HashMap;
import java.util.Iterator;

View File

@ -1,4 +1,4 @@
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;
import cn.hutool.core.map.FixedLinkedHashMap;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;
import cn.hutool.core.collection.CopiedIter;

View File

@ -1,4 +1,4 @@
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;
import cn.hutool.core.collection.CopiedIter;

View File

@ -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;

View 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;

View File

@ -4,4 +4,4 @@
* @author looly
*
*/
package cn.hutool.cache.impl;
package cn.hutool.core.cache.impl;

View File

@ -4,4 +4,4 @@
* @author looly
*
*/
package cn.hutool.cache;
package cn.hutool.core.cache;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,7 +0,0 @@
/**
* GIF处理来自https://github.com/rtyley/animated-gif-lib-for-java
*
* @author looly
*
*/
package cn.hutool.core.img.gif;

View File

@ -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;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.bitMap;
package cn.hutool.core.map.bitMap;
/**
* BitMap接口用于将某个int或long值映射到一个数组中从而判定某个值是否存在

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.bitMap;
package cn.hutool.core.map.bitMap;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.bitMap;
package cn.hutool.core.map.bitMap;
import java.io.Serializable;

View File

@ -4,4 +4,4 @@
* @author looly
*
*/
package cn.hutool.bloomfilter.bitMap;
package cn.hutool.core.map.bitMap;

View File

@ -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;

View File

@ -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;
/**

View File

@ -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;
/**

View File

@ -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;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter;
package cn.hutool.core.text.bloomfilter;
import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter;
package cn.hutool.core.text.bloomfilter;
/**
* 布隆过滤器工具

View File

@ -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过滤器

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -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;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -1,4 +1,4 @@
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;
import cn.hutool.core.util.HashUtil;

View File

@ -4,4 +4,4 @@
* @author looly
*
*/
package cn.hutool.bloomfilter.filter;
package cn.hutool.core.text.bloomfilter.filter;

View File

@ -4,4 +4,4 @@
* @author looly
*
*/
package cn.hutool.bloomfilter;
package cn.hutool.core.text.bloomfilter;

View File

@ -1,4 +1,4 @@
package cn.hutool.dfa;
package cn.hutool.core.text.dfa;
import cn.hutool.core.lang.DefaultSegment;

View File

@ -1,4 +1,4 @@
package cn.hutool.dfa;
package cn.hutool.core.text.dfa;
/**
* @author 肖海斌

View File

@ -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);
}
/**
* 处理过滤文本中的敏感词默认替换成*
*

View File

@ -1,4 +1,4 @@
package cn.hutool.dfa;
package cn.hutool.core.text.dfa;
import java.util.Set;

View File

@ -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;

View File

@ -6,4 +6,4 @@
* @author looly
*
*/
package cn.hutool.dfa;
package cn.hutool.core.text.dfa;

View File

@ -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
*/

View 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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
/**
* 文件缓存单元测试

View File

@ -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的位置不确定
* 并可能引起死锁
*/

View 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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -1,4 +1,4 @@
package cn.hutool.dfa;
package cn.hutool.core.text.dfa;
import cn.hutool.core.collection.CollUtil;
import org.junit.Assert;

View File

@ -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

View File

@ -1,5 +1,6 @@
package cn.hutool.core.util;
import cn.hutool.core.text.escape.EscapeUtil;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,5 +1,6 @@
package cn.hutool.core.util;
import cn.hutool.core.codec.HexUtil;
import org.junit.Assert;
import org.junit.Test;

View File

@ -1,13 +1,11 @@
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;
/**
@ -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'");
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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