?? copyoftaskproperties.java
字號:
/*
* *****************************************************
* Copyright (c) 2005 IIM Lab. All Rights Reserved.
* Created by xuehao at 2005-10-12
* Contact: zxuehao@mail.ustc.edu.cn
* *****************************************************
*/
package org.indigo.util;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Properties;
/**
* 利用java中Properties獲取屬性。
* @author wbz
*
*/
public class CopyOfTaskProperties
{
private static Properties itsProps = null;
private static HashMap itsMap = null;
public void open( String file, String encoding )
{
encoding = "gb2312";
}
/**
* 把指定的文件和屬性對象關(guān)聯(lián)起來。
* @param file
*/
public void open( String file )
{
InputStream is = null;
if( itsProps==null )
{
is = getClass().getResourceAsStream( file );
itsProps = new Properties();
}
try
{
// itsProps.clear();
itsProps.load(is);
} catch (IOException e)
{
e.printStackTrace();
}
}
/**
* 獲取指定關(guān)鍵字的屬性值。
* @param key
* @return
*/
public String getProperty(String key)
{
return itsProps.getProperty(key);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -