<commit_before>package com.openrdf.utils.url.properties;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * Utils URL Properties 单子类: 用来实例化跳转地址。
 * 
 * @description 本程序用于来自谢先斌毕业论文，如有使用请联系作 者，注明出处。
 * @URL 代码地址：http://github.com/openRDF/rdf_fronts
 * @rdf com.openrdf.utils.url.properties
 * @dateTime 2014-5-2
 * @author XieXianbin
 * @email <EMAIL>
 * 
 */
public class URLPropertiesUtils {

	final static Logger log = Logger.getLogger(URLPropertiesUtils.class);
	// URL地址属性
	private static Properties URLProperties = null; 
	// CAS
	public static String RDF_CAS_HREF="RDF_CAS_HREF";
	// 后台
	public static String RDF_BACKEND_HREF="RDF_BACKEND_HREF";
	// 前台
	public static String RDF_FRONTS_HREF="RDF_FRONTS_HREF";
	
	// 获取URL地址 
	public static String getPropertiesUrl(String URLKey){
		return getURLProperties().getProperty(URLKey);
	}
	
	// 单子类 实例化
	public static Properties getURLProperties(){
		if(URLProperties == null){
			// 系统发布路径
			String systemPath = URLPropertiesUtils.class.getClassLoader().getParent().toString();
			// 网址配置文件位置
			String proFilePath = systemPath + "WEB-INF/classes/url.properties"; 
			InputStream inputStream = null;
			try {
				inputStream = new FileInputStream(proFilePath);
				URLProperties.load(inputStream);
			} catch (FileNotFoundException e) {
//				e.printStackTrace();
				log.error("Could NOT Found config.properties File in the Project dir.");
			} catch (IOException e) {
//				e.printStackTrace();
				log.error("When read config.properties Occor an IOException: " + e + ".");<commit_msg>add url properties<commit_after>package com.openrdf.utils.url.properties;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

/**
 * Utils URL Properties 单子类: 用来实例化跳转地址。
 * 
 * @description 本程序用于来自谢先斌毕业论文，如有使用请联系作 者，注明出处。
 * @URL 代码地址：http://github.com/openRDF/rdf_fronts
 * @rdf com.openrdf.utils.url.properties
 * @dateTime 2014-5-2
 * @author XieXianbin
 * @email <EMAIL>
 * 
 */
public class URLPropertiesUtils {

	final static Logger log = Logger.getLogger(URLPropertiesUtils.class);
	// URL地址属性
	private static Properties URLProperties = null; 
	// CAS
	public static final String RDF_CAS_HREF="RDF_CAS_HREF";
	// 后台
	public static final String RDF_BACKEND_HREF="RDF_BACKEND_HREF";
	// 前台
	public static final String RDF_FRONTS_HREF="RDF_FRONTS_HREF";
	
	// 获取URL地址 
	public static String getPropertiesUrl(String URLKey){
		return getURLProperties().getProperty(URLKey);
	}
	
	// 单子类 实例化
	public static Properties getURLProperties(){
		if(URLProperties == null){
			// 系统发布路径
			String systemPath = URLPropertiesUtils.class.getClassLoader().getResource("/").getPath();
			// 网址配置文件位置
			String proFilePath = systemPath + "url.properties"; 
			log.debug(proFilePath);
			InputStream inputStream = null;
			try {
				inputStream = new FileInputStream(proFilePath);
				URLProperties = new Properties();
				URLProperties.load(inputStream);
			} catch (FileNotFoundException e) {
//				e.printStackTrace();
				log.error("Could NOT Found config.properties File in the Project dir.");
			} catch (IOException e) {
//				e.printStackTrace();
				log.error("When read config.properties Occor an IOException: " + e + ".");
{'fraction_non_alphanumeric': 0.11563044741429401, 'fraction_numerical': 0.004067402672864613, 'mean_word_length': 4.337984496124031, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6543060', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1223, 'n_words': 245}