org.nervousync.commons.Globals Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils-jdk11 Show documentation
Show all versions of utils-jdk11 Show documentation
Java utility collections, development by Nervousync Studio (NSYC)
/*
* Licensed to the Nervousync Studio (NSYC) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nervousync.commons;
import java.io.File;
import java.util.Locale;
/**
* Globals constants Value
* 全局常量值
*
* @author Steven Wee [email protected]
* @version $Revision: 1.1.4 $ $Date: Jul 2, 2018 18:44:29 $
*/
public final class Globals {
/**
* Multiplier value of calculate hash result.
* 计算哈希值需要用到的乘数
*/
public static final int MULTIPLIER = 31;
/**
* Default value of buffer size
* 默认缓冲区大小
*/
public static final int DEFAULT_BUFFER_SIZE = 8192;
/**
* Default value of file reader buffer size
* 文件读取的默认缓冲区大小
*/
public static final int READ_FILE_BUFFER_SIZE = 32768;
/**
* Default value of timeout
* 默认超时时间
*/
public static final int DEFAULT_TIME_OUT = 0;
/**
* Default value of primitive type int
* int基础类型的默认值
*/
public static final int DEFAULT_VALUE_INT = -1;
/**
* Default value of primitive type long
* long基础类型的默认值
*/
public static final long DEFAULT_VALUE_LONG = -1L;
/**
* Default value of primitive type short
* short基础类型的默认值
*/
public static final short DEFAULT_VALUE_SHORT = -1;
/**
* Default value of primitive type double
* double基础类型的默认值
*/
public static final double DEFAULT_VALUE_DOUBLE = -1;
/**
* Default value of primitive type float
* float基础类型的默认值
*/
public static final float DEFAULT_VALUE_FLOAT = -1;
/**
* Default value of type String
* String类型的默认值
*/
public static final String DEFAULT_VALUE_STRING = "";
/**
* Default value of reference time using it for Snowflake ID generator
* 默认起始时间戳值,用于雪花算法ID生成器
*/
public static final long DEFAULT_REFERENCE_TIME = 1303315200000L;
/**
* The constant value of SAMBA protocol prefix
* Samba协议的起始前缀值
*/
public static final String SAMBA_PROTOCOL = "smb://";
/**
* The constant value of HTTP protocol prefix
* HTTP协议的起始前缀值
*/
public static final String HTTP_PROTOCOL = "http://";
/**
* The constant value of SecureHTTP protocol prefix
* 安全HTTP协议的起始前缀值
*/
public static final String SECURE_HTTP_PROTOCOL = "https://";
/**
* The constant value of extension separator
* 扩展名分割字符
*/
public static final char EXTENSION_SEPARATOR = '.';
/**
* The constant value of default package separator
* 默认包名分隔符
*/
public static final char DEFAULT_PACKAGE_SEPARATOR = '.';
/**
* The constant value of email folder: INBOX
* 收件箱电子邮件文件夹的默认值
*/
public static final String DEFAULT_EMAIL_FOLDER_INBOX = "INBOX";
/**
* The constant value of email folder: SPAM
* 垃圾邮件电子邮件文件夹的默认值
*/
public static final String DEFAULT_EMAIL_FOLDER_SPAM = "Spam";
/**
* The constant value of email folder: DRAFTS
* 草稿箱电子邮件文件夹的默认值
*/
public static final String DEFAULT_EMAIL_FOLDER_DRAFTS = "Drafts";
/**
* The constant value of email folder: TRASH
* 垃圾箱电子邮件文件夹的默认值
*/
public static final String DEFAULT_EMAIL_FOLDER_TRASH = "Trash";
/**
* The constant value of email folder: SENT
* 发件箱电子邮件文件夹的默认值
*/
public static final String DEFAULT_EMAIL_FOLDER_SENT = "Sent";
/**
* The constant value of default character encoding
* 默认的字符集编码
*/
public static final String DEFAULT_ENCODING = "UTF-8";
/**
* The constant value of CP850 character encoding
* CP850字符集编码
*/
public static final String CHARSET_CP850 = "Cp850";
/**
* The constant value of GBK character encoding
* GBK字符集编码
*/
public static final String CHARSET_GBK = "GBK";
/**
* The constant value of current system default locale
* 当前系统的默认语言信息
*/
public static final Locale DEFAULT_LOCALE = Locale.getDefault();
/**
* The constant value of current system character encoding
* 当前系统的默认字符集编码
*/
public static final String DEFAULT_SYSTEM_CHARSET = System.getProperty("file.encoding");
/**
* The constant value of default split separator
* 默认的分割字符
*/
public static final String DEFAULT_SPLIT_SEPARATOR = ",";
/**
* The constant value of current system default page separator
* 当前系统的默认名称分隔符
*/
public static final String DEFAULT_PAGE_SEPARATOR = File.separator;
/**
* The constant value of default url separator
* 默认url分隔符
*/
public static final String DEFAULT_URL_SEPARATOR = "/";
/**
* The constant value of default resource separator
* 默认资源路径分隔符
*/
public static final char DEFAULT_RESOURCE_SEPARATOR = '/';
/**
* The constant value of default jar page separator
* Jar包内默认名称分隔符
*/
public static final String DEFAULT_JAR_PAGE_SEPARATOR = "\\";
/**
* The constant value of Content-Type: TEXT
* 文本内容类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_TEXT = "text/plain";
/**
* The constant value of Content-Type: HTML
* 超文本内容类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_HTML = "text/html";
/**
* The constant value of Content-Type: MULTIPART
* 多媒体内容类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_MULTIPART = "multipart/*";
/**
* The constant value of Content-Type: RFC-822
* RFC-822内容类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_MESSAGE_RFC822 = "message/rfc822";
/**
* The constant value of Content-Type: ENCODED
* 表单编码类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_ENCODED = "application/x-www-form-urlencoded";
/**
* The constant value of Content-Type: FORM_DATA MULTIPART
* 表单多媒体类型的定义字符串
*/
// Multipart content type
public static final String FORM_DATA_CONTENT_TYPE_MULTIPART = "multipart/form-data";
/**
* The constant value of Content-Type: MIXED
* 混合数据类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_MIXED = "multipart/mixed";
/**
* The constant value of Content-Type: BINARY
* 二进制数据类型的定义字符串
*/
public static final String DEFAULT_CONTENT_TYPE_BINARY = "application/octet-stream";
/**
* The constant value of Content-Disposition
* 多部份主体的标头
*/
public static final String FORM_DATA_CONTENT_DISPOSITION = "form-data";
/**
* Default value of temporary secure name
* 默认的临时安全名称
*/
public static final String DEFAULT_TEMPORARY_SECURE_NAME = "Secure_Tmp";
/**
* Default value of log file path
* 默认的日志文件路径
*/
public static final String DEFAULT_LOG_FILE_PATH = Globals.DEFAULT_PAGE_SEPARATOR + "nervousync-log.log";
/**
* Default value of boolean value FALSE to int
* 默认的布尔值FALSE,用int表示
*/
public static final int DEFAULT_STATUS_FALSE = 0;
/**
* Default value of boolean value TRUE to int
* 默认的布尔值TRUE,用int表示
*/
public static final int DEFAULT_STATUS_TRUE = 1;
/**
* Initialize value of primitive type int
* int类型的初始值
*/
public static final int INITIALIZE_INT_VALUE = 0;
/*
* Header signatures
*/
/**
* Local file header signature, read as a little-endian number
* 文件头标识值,小端读取
*/
public static final long LOCSIG = 0x04034b50L;
/**
* Data descriptor signature, read as a little-endian number
* 数据描述符标识值,小端读取
*/
public static final long EXTSIG = 0x08074b50L;
/**
* Central directory file header signature, read as a little-endian number
* 中央目录文件头标识值,小端读取
*/
public static final long CENSIG = 0x02014b50L;
/**
* Central directory end signature, read as a little-endian number
* 中央目录结束标识值,小端读取
*/
public static final long ENDSIG = 0x06054b50L;
/**
* Digital signature, read as a little-endian number
* 数字签名标识值,小端读取
*/
public static final long DIGSIG = 0x05054b50L;
/**
* Archive extra data record signature, read as a little-endian number
* 文档额外数据记录标识值,小端读取
*/
public static final long ARCEXTDATREC = 0x08064b50L;
/**
* ZIP64 end of central directory locator signature, read as a little-endian number
* ZIP64核心目录位置标识值,小端读取
*/
public static final long ZIP64ENDCENDIRLOC = 0x07064b50L;
/**
* ZIP64 end of central directory signature, read as a little-endian number
* ZIP64核心目录结束标识值,小端读取
*/
public static final long ZIP64ENDCENDIRREC = 0x06064b50;
/**
* ZIP64 extended information extra field
* ZIP64扩展信息扩展块
*/
public static final int EXTRAFIELDZIP64LENGTH = 0x0001;
/**
* AES encrypt signature
* AES加密标识
*/
public static final int AESSIG = 0x9901;
/**
* Maximum length of comment data bytes
* 注释字节数组的最大长度
*/
public static final int MAX_ALLOWED_ZIP_COMMENT_LENGTH = 0xFFFF;
/**
* Compression Type: STORE
* 压缩类型:STORE
*/
public static final int COMP_STORE = 0;
/**
* Compression Type: DEFLATE
* 压缩类型:DEFLATE
*/
public static final int COMP_DEFLATE = 8;
/**
* AES authentication data length
* AES验证数据长度
*/
public static final int AES_AUTH_LENGTH = 10;
/**
* AES block length
* AES数据块大小
*/
public static final int AES_BLOCK_SIZE = 16;
/**
* AES strength length: 128
* AES加密强度:128
*/
public static final int AES_STRENGTH_128 = 0x01;
/**
* AES strength length: 192
* AES加密强度:192
*/
public static final int AES_STRENGTH_192 = 0x02;
/**
* AES strength length: 256
* AES加密强度:256
*/
public static final int AES_STRENGTH_256 = 0x03;
/**
* Minimum length of split zip file
* ZIP文件分割最小长度
*/
public static final int MIN_SPLIT_LENGTH = 65536;
/**
* Limit size of ZIP64
* ZIP64规定的最大限制
*/
public static final long ZIP_64_LIMIT = 4294967295L;
/**
* The constant UFT8_NAMES_FLAG.
*/
public static final int UFT8_NAMES_FLAG = 1 << 11;
/**
* Encryption types
*/
public static final int ENC_NO_ENCRYPTION = -1;
/**
* The constant ENC_METHOD_STANDARD.
*/
public static final int ENC_METHOD_STANDARD = 0;
/**
* The constant ENC_METHOD_STRONG.
*/
public static final int ENC_METHOD_STRONG = 1;
/**
* The constant ENC_METHOD_AES.
*/
public static final int ENC_METHOD_AES = 99;
/**
* Compression level for deflate algorithm
*/
public static final int DEFLATE_LEVEL_FASTEST = 1;
/**
* The constant DEFLATE_LEVEL_FAST.
*/
public static final int DEFLATE_LEVEL_FAST = 3;
/**
* The constant DEFLATE_LEVEL_NORMAL.
*/
public static final int DEFLATE_LEVEL_NORMAL = 5;
/**
* The constant DEFLATE_LEVEL_MAXIMUM.
*/
public static final int DEFLATE_LEVEL_MAXIMUM = 7;
/**
* The constant DEFLATE_LEVEL_ULTRA.
*/
public static final int DEFLATE_LEVEL_ULTRA = 9;
/**
* The constant PASSWORD_VERIFIER_LENGTH.
*/
public static final int PASSWORD_VERIFIER_LENGTH = 2;
/**
* The constant STD_DEC_HDR_SIZE.
*/
public static final int STD_DEC_HDR_SIZE = 12;
/**
* The constant ENDHDR.
*/
public static final int ENDHDR = 22; // END header size
/**
* The constant BUFFER_SIZE.
*/
public static final int BUFFER_SIZE = 1024 * 4;
/**
* The constant ZIP64_EXTRA_BUFFER_SIZE.
*/
public static final int ZIP64_EXTRA_BUFFER_SIZE = 50;
/**
* The constant FILE_MODE_NONE.
*/
public static final int FILE_MODE_NONE = 0;
/**
* The constant FILE_MODE_READ_ONLY.
*/
public static final int FILE_MODE_READ_ONLY = 1;
/**
* The constant FOLDER_MODE_NONE.
*/
public static final int FOLDER_MODE_NONE = 16;
/**
* The constant DEFAULT_ZIP_PAGE_SEPARATOR.
*/
public static final String DEFAULT_ZIP_PAGE_SEPARATOR = "/";
/**
* The constant ZIP_ENTRY_SEPARATOR.
*/
public static final String DEFAULT_ZIP_ENTRY_SEPARATOR = ":" + Globals.DEFAULT_ZIP_PAGE_SEPARATOR;
private Globals() {
}
}