com.foxinmy.weixin4j.util
Class ServerToolkits

java.lang.Object
  extended by com.foxinmy.weixin4j.util.ServerToolkits

public final class ServerToolkits
extends Object

工具包

Since:
JDK 1.7
Author:
jinyu(foxinmy@gmail.com)
See Also:

Field Summary
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
ServerToolkits()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

ServerToolkits

public ServerToolkits()
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:


Copyright © 2014–2017. All rights reserved.