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 StringAESstatic StringCONTENTTYPE$APPLICATION_XMLstatic StringCONTENTTYPE$TEXT_PLAINstatic io.netty.util.AttributeKey<WeixinMessageTransfer>MESSAGE_TRANSFER_KEYstatic StringPROTOCOL_FILEstatic StringPROTOCOL_JARstatic StringSHA1static CharsetUTF_8
-
Constructor Summary
Constructors Constructor Description ServerToolkits()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringdigestSHA1(String content)SHA1签名static StringgenerateRandomString(int length)返回一个定长的随机字符串(包含数字和大小写字母)static byte[]getBytesUtf8(String content)static booleanisBlank(CharSequence cs)判断字符串是否为空static voidmakeConstructorAccessible(Constructor<?> ctor)构造器设置为可见static StringnewStringUtf8(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:
-
-