mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
remove deprecated
This commit is contained in:
@@ -241,17 +241,6 @@ public class HttpRequest extends HttpBase<HttpRequest> {
|
||||
*/
|
||||
private int redirectCount;
|
||||
|
||||
/**
|
||||
* 构造,URL编码默认使用UTF-8
|
||||
*
|
||||
* @param url URL
|
||||
* @deprecated 请使用 {@link #of(String)}
|
||||
*/
|
||||
@Deprecated
|
||||
public HttpRequest(String url) {
|
||||
this(UrlBuilder.ofHttp(url));
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*
|
||||
|
@@ -436,20 +436,6 @@ public class HttpUtil {
|
||||
return toParams(paramMap, CharsetUtil.CHARSET_UTF_8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Map形式的Form表单数据转换为Url参数形式<br>
|
||||
* 编码键和值对
|
||||
*
|
||||
* @param paramMap 表单数据
|
||||
* @param charsetName 编码
|
||||
* @return url参数
|
||||
* @deprecated 请使用 {@link #toParams(Map, Charset)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static String toParams(Map<String, Object> paramMap, String charsetName) {
|
||||
return toParams(paramMap, CharsetUtil.charset(charsetName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Map形式的Form表单数据转换为Url参数形式<br>
|
||||
* paramMap中如果key为空(null和"")会被忽略,如果value为null,会被做为空白符("")<br>
|
||||
|
@@ -1,95 +0,0 @@
|
||||
package cn.hutool.http.ssl;
|
||||
|
||||
import cn.hutool.core.net.SSLContextBuilder;
|
||||
import cn.hutool.core.net.SSLProtocols;
|
||||
|
||||
import javax.net.ssl.KeyManager;
|
||||
import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import java.security.KeyManagementException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
/**
|
||||
* SSLSocketFactory构建器
|
||||
*
|
||||
* @author Looly
|
||||
* @see SSLContextBuilder
|
||||
* @deprecated 请使用 {@link SSLContextBuilder}
|
||||
*/
|
||||
@Deprecated
|
||||
public class SSLSocketFactoryBuilder implements SSLProtocols {
|
||||
|
||||
SSLContextBuilder sslContextBuilder;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*/
|
||||
public SSLSocketFactoryBuilder() {
|
||||
this.sslContextBuilder = SSLContextBuilder.create();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 SSLSocketFactoryBuilder
|
||||
*
|
||||
* @return SSLSocketFactoryBuilder
|
||||
*/
|
||||
public static SSLSocketFactoryBuilder create() {
|
||||
return new SSLSocketFactoryBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置协议
|
||||
*
|
||||
* @param protocol 协议
|
||||
* @return 自身
|
||||
*/
|
||||
public SSLSocketFactoryBuilder setProtocol(String protocol) {
|
||||
this.sslContextBuilder.setProtocol(protocol);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置信任信息
|
||||
*
|
||||
* @param trustManagers TrustManager列表
|
||||
* @return 自身
|
||||
*/
|
||||
public SSLSocketFactoryBuilder setTrustManagers(TrustManager... trustManagers) {
|
||||
this.sslContextBuilder.setTrustManagers(trustManagers);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 JSSE key managers
|
||||
*
|
||||
* @param keyManagers JSSE key managers
|
||||
* @return 自身
|
||||
*/
|
||||
public SSLSocketFactoryBuilder setKeyManagers(KeyManager... keyManagers) {
|
||||
this.sslContextBuilder.setKeyManagers(keyManagers);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 SecureRandom
|
||||
*
|
||||
* @param secureRandom SecureRandom
|
||||
* @return 自己
|
||||
*/
|
||||
public SSLSocketFactoryBuilder setSecureRandom(SecureRandom secureRandom) {
|
||||
this.sslContextBuilder.setSecureRandom(secureRandom);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建SSLSocketFactory
|
||||
*
|
||||
* @return SSLSocketFactory
|
||||
* @throws NoSuchAlgorithmException 无此算法
|
||||
* @throws KeyManagementException Key管理异常
|
||||
*/
|
||||
public SSLSocketFactory build() throws NoSuchAlgorithmException, KeyManagementException {
|
||||
return this.sslContextBuilder.buildChecked().getSocketFactory();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user