package com.foxinmy.weixin4j.util;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.util.Properties;

/**
 * 常量类
 *
 * @className Consts
 * @author jinyu(foxinmy@gmail.com)
 * @date 2014年12月3日
 * @since JDK 1.6
 * @see
 */
public final class Consts {

	private static Properties loadProperties() {
		Properties properties = new Properties();
		InputStream inputStream = Consts.class.getResourceAsStream("/com/foxinmy/weixin4j/weixin4j.properties");
		try {
			properties.load(inputStream);
		} catch (IOException e) {
			throw new RuntimeException(e);
		} finally {
			IOUtil.close(inputStream);
		}
		return properties;
	}

	private static final Properties PROPERTIES = loadProperties();

	public static final String WEIXIN4J = PROPERTIES.getProperty("weixin4j.name");
	public static final String VERSION = PROPERTIES.getProperty("weixin4j.version");
	public static final Charset UTF_8 = Charset.forName("UTF-8");
	public static final Charset GBK = Charset.forName("GBK");
	public static final String SUCCESS = "SUCCESS";
	public static final String FAIL = "FAIL";
	public static final String SunX509 = "SunX509";
	public static final String JKS = "JKS";
	public static final String PKCS12 = "PKCS12";
	public static final String TLS = "TLS";
	public static final String X509 = "X.509";
	public static final String AES = "AES";
	public static final String MD5 = "MD5";
	public static final String SHA = "SHA";
	public static final String SHA1 = "SHA-1";
	public static final String PROTOCOL_FILE = "file";
	public static final String PROTOCOL_JAR = "jar";
	public static final String SEPARATOR = ",";
}
