Package com.foxinmy.weixin4j.util
Class ServerToolkits
- java.lang.Object
-
- com.foxinmy.weixin4j.util.ServerToolkits
-
public final class ServerToolkits extends Object
工具包- Since:
- JDK 1.7
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description static String
AES
static String
CONTENTTYPE$APPLICATION_XML
static String
CONTENTTYPE$TEXT_PLAIN
static io.netty.util.AttributeKey<WeixinMessageTransfer>
MESSAGE_TRANSFER_KEY
static String
PROTOCOL_FILE
static String
PROTOCOL_JAR
static String
SHA1
static Charset
UTF_8
-
Constructor Summary
Constructors Constructor Description ServerToolkits()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
digestSHA1(String content)
SHA1签名static String
generateRandomString(int length)
返回一个定长的随机字符串(包含数字和大小写字母)static byte[]
getBytesUtf8(String content)
static boolean
isBlank(CharSequence cs)
判断字符串是否为空static void
makeConstructorAccessible(Constructor<?> ctor)
构造器设置为可见static String
newStringUtf8(byte[] bytes)
-
-
-
Field Detail
-
UTF_8
public static final Charset UTF_8
-
AES
public static final String AES
- See Also:
- Constant Field Values
-
SHA1
public static final String SHA1
- See Also:
- Constant Field Values
-
PROTOCOL_FILE
public static final String PROTOCOL_FILE
- See Also:
- Constant Field Values
-
PROTOCOL_JAR
public static final String PROTOCOL_JAR
- See Also:
- Constant Field Values
-
CONTENTTYPE$APPLICATION_XML
public static final String CONTENTTYPE$APPLICATION_XML
- See Also:
- Constant Field Values
-
CONTENTTYPE$TEXT_PLAIN
public static final String CONTENTTYPE$TEXT_PLAIN
- See Also:
- Constant Field Values
-
MESSAGE_TRANSFER_KEY
public static final io.netty.util.AttributeKey<WeixinMessageTransfer> MESSAGE_TRANSFER_KEY
-
-
Method Detail
-
generateRandomString
public static String generateRandomString(int length)
返回一个定长的随机字符串(包含数字和大小写字母)- Parameters:
length
- 随机数的长度- Returns:
-
makeConstructorAccessible
public static void makeConstructorAccessible(Constructor<?> ctor)
构造器设置为可见- Parameters:
ctor
-
-
digestSHA1
public static String digestSHA1(String content)
SHA1签名- Parameters:
content
- 待签名字符串- Returns:
- 签名后的字符串
-
getBytesUtf8
public static byte[] getBytesUtf8(String content)
-
newStringUtf8
public static String newStringUtf8(byte[] bytes)
-
isBlank
public static boolean isBlank(CharSequence cs)
判断字符串是否为空- Parameters:
cs
-- Returns:
-
-