亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? confighelper.java

?? hibernate-3.1.3-all-src.zip 面向?qū)ο蟮脑L問數(shù)據(jù)庫工具
?? JAVA
字號:
// $Id: ConfigHelper.java 8231 2005-09-27 20:41:42Z oneovthafew $
package org.hibernate.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.cfg.Environment;

/**
 * A simple class to centralize logic needed to locate config files on the system.
 *
 * @author Steve
 */
public final class ConfigHelper {
	private static final Log log = LogFactory.getLog(ConfigHelper.class);

	/** Try to locate a local URL representing the incoming path.  The first attempt
	 * assumes that the incoming path is an actual URL string (file://, etc).  If this
	 * does not work, then the next attempts try to locate this UURL as a java system
	 * resource.
	 *
	 * @param path The path representing the config location.
	 * @return An appropriate URL or null.
	 */
	public static final URL locateConfig(final String path) {
		try {
			return new URL(path);
		}
		catch(MalformedURLException e) {
			return findAsResource(path);
		}
	}

	/** 
	 * Try to locate a local URL representing the incoming path.  
	 * This method <b>only</b> attempts to locate this URL as a 
	 * java system resource.
	 *
	 * @param path The path representing the config location.
	 * @return An appropriate URL or null.
	 */
	public static final URL findAsResource(final String path) {
		URL url = null;

		// First, try to locate this resource through the current
		// context classloader.
		ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
		if (contextClassLoader!=null) {
			url = contextClassLoader.getResource(path);
		}
		if (url != null)
			return url;

		// Next, try to locate this resource through this class's classloader
		url = ConfigHelper.class.getClassLoader().getResource(path);
		if (url != null)
			return url;

		// Next, try to locate this resource through the system classloader
		url = ClassLoader.getSystemClassLoader().getResource(path);

		// Anywhere else we should look?
		return url;
	}

	/** Open an InputStream to the URL represented by the incoming path.  First makes a call
	 * to {@link #locateConfig(java.lang.String)} in order to find an appropriate URL.
	 * {@link java.net.URL#openStream()} is then called to obtain the stream.
	 *
	 * @param path The path representing the config location.
	 * @return An input stream to the requested config resource.
	 * @throws HibernateException Unable to open stream to that resource.
	 */
	public static final InputStream getConfigStream(final String path) throws HibernateException {
		final URL url = ConfigHelper.locateConfig(path);

		if (url == null) {
			String msg = "Unable to locate config file: " + path;
			log.fatal(msg);
			throw new HibernateException(msg);
		}

		try {
			return url.openStream();
        }
		catch(IOException e) {
	        throw new HibernateException("Unable to open config file: " + path, e);
        }
	}

	/** Open an Reader to the URL represented by the incoming path.  First makes a call
	 * to {@link #locateConfig(java.lang.String)} in order to find an appropriate URL.
	 * {@link java.net.URL#openStream()} is then called to obtain a stream, which is then
	 * wrapped in a Reader.
	 *
	 * @param path The path representing the config location.
	 * @return An input stream to the requested config resource.
	 * @throws HibernateException Unable to open reader to that resource.
	 */
	public static final Reader getConfigStreamReader(final String path) throws HibernateException {
		return new InputStreamReader( getConfigStream(path) );
	}

	/** Loads a properties instance based on the data at the incoming config location.
	 *
	 * @param path The path representing the config location.
	 * @return The loaded properties instance.
	 * @throws HibernateException Unable to load properties from that resource.
	 */
	public static final Properties getConfigProperties(String path) throws HibernateException {
		try {
			Properties properties = new Properties();
			properties.load( getConfigStream(path) );
			return properties;
		}
		catch(IOException e) {
			throw new HibernateException("Unable to load properties from specified config file: " + path, e);
		}
	}
	
	private ConfigHelper() {}

	public static InputStream getResourceAsStream(String resource) {
		String stripped = resource.startsWith("/") ? 
				resource.substring(1) : resource;
	
		InputStream stream = null; 
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		if (classLoader!=null) {
			stream = classLoader.getResourceAsStream( stripped );
		}
		if ( stream == null ) {
			Environment.class.getResourceAsStream( resource );
		}
		if ( stream == null ) {
			stream = Environment.class.getClassLoader().getResourceAsStream( stripped );
		}
		if ( stream == null ) {
			throw new HibernateException( resource + " not found" );
		}
		return stream;
	}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级黄色大片| 亚洲va在线va天堂| 一级中文字幕一区二区| 青青草国产精品97视觉盛宴| 国产麻豆精品视频| 69堂国产成人免费视频| 日韩美女久久久| 国产一区二区视频在线播放| 欧美日韩精品一区二区三区| 国产精品三级电影| 精品一区二区三区视频在线观看| 欧美性xxxxxx少妇| 亚洲色图.com| www.欧美色图| 久久久精品欧美丰满| 美女视频黄 久久| 欧美精三区欧美精三区 | 一本大道久久a久久综合婷婷| 日韩一区二区三区视频在线| 亚洲国产精品久久人人爱| 国产91富婆露脸刺激对白| 亚洲精品在线观| 六月丁香婷婷久久| 91精品免费在线观看| 亚洲国产一区二区视频| 色综合久久久网| 亚洲欧美日韩一区| jizz一区二区| 最好看的中文字幕久久| 成人免费观看av| 国产精品不卡在线观看| 岛国一区二区在线观看| 欧美国产日韩精品免费观看| 国产伦精品一区二区三区免费迷 | www激情久久| 麻豆国产一区二区| 久久午夜老司机| 粉嫩绯色av一区二区在线观看| 久久久美女毛片| 成人午夜电影久久影院| 国产精品久久久久久户外露出| 成人免费视频视频| 一区二区三区蜜桃网| 欧美亚洲国产一区在线观看网站| 一卡二卡欧美日韩| 日韩一区二区免费视频| 久久91精品久久久久久秒播| 国产午夜亚洲精品理论片色戒| 国产毛片精品视频| 亚洲欧美成aⅴ人在线观看| 欧美性生活影院| 蜜臀av性久久久久av蜜臀妖精| 精品国产区一区| 99久久99久久综合| 亚洲mv在线观看| xf在线a精品一区二区视频网站| 成人午夜激情片| 亚洲国产日韩av| 久久久久综合网| 91国偷自产一区二区三区观看| 亚洲成人黄色小说| 日韩精品中文字幕一区二区三区| 豆国产96在线|亚洲| 亚洲综合图片区| 日韩午夜小视频| 99久久婷婷国产综合精品| 五月天网站亚洲| 国产丝袜在线精品| 欧美高清视频一二三区| 国产精品一区二区三区99| 亚洲一区二区精品久久av| 久久亚洲精品小早川怜子| 在线免费不卡视频| 国产高清不卡一区| 亚洲线精品一区二区三区八戒| 精品国产免费久久| 欧美性猛交xxxx乱大交退制版 | 久久人人爽爽爽人久久久| 91麻豆精品一区二区三区| 久久国产日韩欧美精品| 夜夜亚洲天天久久| 国产精品国产a级| 久久蜜桃一区二区| 欧美一区二区三区影视| 色综合久久久久网| 成av人片一区二区| 国产一区二区三区四区五区美女 | 亚洲人成在线观看一区二区| 精品国产乱码久久久久久1区2区| 在线视频一区二区三| 99久久久无码国产精品| 黄网站免费久久| 视频一区二区中文字幕| 亚洲精品成人a在线观看| 国产精品毛片a∨一区二区三区| 欧美大胆人体bbbb| 9191久久久久久久久久久| 日本韩国一区二区| 97久久超碰国产精品电影| 国产99久久久国产精品免费看| 理论电影国产精品| 日韩av在线播放中文字幕| 亚洲国产人成综合网站| 一区二区在线观看视频| 亚洲欧美日韩小说| 亚洲欧美日韩人成在线播放| 国产精品成人在线观看| 国产欧美在线观看一区| 精品国产制服丝袜高跟| 日韩欧美第一区| 日韩视频免费观看高清完整版在线观看| 欧美视频在线播放| 欧美日韩日日夜夜| 欧美日韩三级在线| 欧美一区二区在线播放| 日韩欧美国产综合一区| 欧美成人aa大片| 亚洲精品在线观看视频| 国产亚洲精品免费| 亚洲国产精品成人综合色在线婷婷| 久久久亚洲高清| 日本一区二区三级电影在线观看| 国产欧美精品日韩区二区麻豆天美| 欧美激情综合网| 亚洲视频综合在线| 一级特黄大欧美久久久| 日本亚洲电影天堂| 国产真实乱子伦精品视频| 国产精品一级二级三级| av在线免费不卡| 日本伦理一区二区| 欧美二区在线观看| 精品国产伦一区二区三区观看方式| 久久久精品免费免费| 亚洲婷婷国产精品电影人久久| 一区二区三区久久久| 日韩av一区二区在线影视| 国产高清在线观看免费不卡| 99re成人精品视频| 欧美一区二区三区在线观看| 国产女同互慰高潮91漫画| 亚洲精品一二三区| 韩国精品主播一区二区在线观看 | 91精品麻豆日日躁夜夜躁| 精品入口麻豆88视频| 国产精品国产三级国产aⅴ中文| 亚洲精品一二三四区| 美女被吸乳得到大胸91| 成人av免费在线| 在线综合亚洲欧美在线视频| 久久久国际精品| 亚洲自拍偷拍麻豆| 国产精品一区在线观看乱码 | 亚洲国产aⅴ成人精品无吗| 日本不卡一区二区| 99久久免费视频.com| 日韩视频一区在线观看| 亚洲日本欧美天堂| 久久99精品久久久久久国产越南| 成人a免费在线看| 日韩一区二区三区av| 一区二区三区精品在线观看| 精品在线你懂的| 欧美亚洲国产bt| 国产欧美日韩在线观看| 五月天丁香久久| 91在线小视频| 久久综合资源网| 日韩精品欧美成人高清一区二区| 波多野结衣亚洲| 精品国产一区二区在线观看| 午夜伊人狠狠久久| 91丝袜国产在线播放| 久久一区二区三区国产精品| 香蕉乱码成人久久天堂爱免费| 成人精品免费视频| 精品国产乱码久久久久久影片| 美国三级日本三级久久99| 99精品1区2区| 国产精品理论片在线观看| 国产在线精品一区二区夜色 | 日韩在线观看一区二区| 91丨九色丨蝌蚪丨老版| 中文字幕不卡在线| 国产麻豆精品久久一二三| 日韩一区二区三区三四区视频在线观看| 一区二区成人在线视频| 成人av在线资源网站| 久久精品人人做人人综合| 精品亚洲成av人在线观看| 欧美三级日本三级少妇99| 亚洲欧美韩国综合色| 91在线免费看| 1024成人网色www| 97se亚洲国产综合自在线| 国产精品沙发午睡系列990531| 国产99久久久久| 国产精品乱码一区二区三区软件| 国产传媒日韩欧美成人| 国产丝袜美腿一区二区三区|