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