/*********************************************************************
* All Rights reserved,Copyright (c) K-Opticom
**********************************************************************
*＜プログラム内容＞
*   システム名      ：eo顧客基幹システム
*   モジュール名    ：JCCDownloadRestrictionCach
*   ソースファイル名：JCCDownloadRestrictionCach.java
*   作成者          ：富士通
*   日付            ：2011年04月27日
*＜機能概要＞
*   ファイルダウンロード定義ファイルキャッシュ部品です
*＜修正履歴＞
*   バージョン  修正日       修正者      修正内容
*   v1.00.00    2011/04/27   FJ          新規作成
*
**********************************************************************/

package eo.web.webview.common;

import com.fujitsu.futurity.common.JCMPropertyCache;
import eo.web.webview.common.JCCWebCommon;


/**
 * ファイルダウンロード定義の読み込みを行うクラス。<p>
 * Webフレームワークが呼び出します。<p>
 * <BR>
 * @author 富士通
 */
public class JCCDownloadRestrictionCache extends JCMPropertyCache
{

	/**
	 * アプリケーションプロパティファイルから、ダウンロード定義ファイルのパス
	 * 及び文字エンコード種別を取得し、シングルトンでインスタンス化します。
	 * 
	 * @param
	 * @return なし
	 */	
	public static void setPath()
	{
    	//アプリケーションプロパティファイルからダウンロード定義ファイルのパスと文字エンコード種別を取得
		String restFilePath = JCCWebCommon.getApplicationConst("DOWNLOAD_FILE_PATH");
		String restFileEncode = JCCWebCommon.getApplicationConst("DOWNLOAD_FILE_ENCODING");

		//シングルトンでインスタンス化
		JCCDownloadRestrictionCache rc = JCCDownloadRestrictionCache.getInstance();
		rc.PATH = restFilePath;
		rc.ENCODING = restFileEncode;
	}

	/** インスタンス領域 */
	private static JCCDownloadRestrictionCache prop = null;

	/**
	 * インスタンス生成メソッド
	 * 
	 * @param
	 * @return prop
	 */	
	private static JCCDownloadRestrictionCache getInstance()
	{
		if(null == prop)
		{
			prop = new JCCDownloadRestrictionCache();
		}
		
		return prop;
	}
	
	/**
	 * キーで指定されたダウンロード定義ファイル情報を取得します。
	 * 
	 * @param key 定義ファイル設定値に対応するキー
	 * @return キーに紐付けられた定義ファイル内の設定値
	 * @exception Exception
	 */	
	public static String getValue(String key) throws Exception
	{
		//親クラスのgetValuePropメソッドを呼び出して返却
		return JCCDownloadRestrictionCache.getInstance().getValueProp(key);
	}
}
