/* * FileNameļ¼Configuration.java *
* Copyright (c) 2017-2020, hermit (794890569@qq.com). *
* Licensed under the GNU General Public License, Version 3 (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.gnu.org/licenses/gpl-3.0.html *
* 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 cn.com.lzt.common.config;
import cn.com.lzt.common.util.StringUtil;
import java.io.File;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;
/**
* @author : hermit
*/
public class Configuration {
private static final String _RES_BASE_NAME = "resources";
public static String ROOT;
public static String CURRENT_PATH;
public static String TEMPLATE_PATH;
public static String TEMPLATE_WEB_PATH;
public static String TEMPORARY_PATH;
public static String LOG_PATH;
public static String CLASSPATH;
public static String CONFIG_PATH;
public static String TEMPLATE_URI = "/WEB-INF/template/views";
public static final String LINE_SEPARATOR = System.getProperty("line.separator");
public static final String PATH_SEPARATOR = System.getProperty("path.separator");
private static final String SECRET_CONFIG = "site.secret";
private static final String DEFAULT_SECRET_KEY = "SECRET_CONFIG";
static {
ROOT = new File(Configuration.class.getResource("/").getPath()).getParentFile().getParent().toString();
CURRENT_PATH = new File(Configuration.class.getResource("/").getPath()).toString();
TEMPLATE_PATH = StringUtil.concat(new Object[]{ROOT, File.separator, "WEB-INF", File.separator, "template"});
TEMPLATE_WEB_PATH = StringUtil.concat(new Object[]{TEMPLATE_PATH, File.separator, "views"});
TEMPORARY_PATH = StringUtil.concat(new Object[]{ROOT, File.separator, "WEB-INF", File.separator, "tmp"});
CONFIG_PATH = StringUtil.concat(new Object[]{ROOT, File.separator, "WEB-INF", File.separator, "conf"});
LOG_PATH = StringUtil.concat(new Object[]{ROOT, File.separator, "WEB-INF", File.separator, "logs"});
StringBuilder sb = new StringBuilder();
// List