📄 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";
}
/**
* 把指定的文件和属性对象关联起来。
* @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();
}
}
/**
* 获取指定关键字的属性值。
* @param key
* @return
*/
public String getProperty(String key)
{
return itsProps.getProperty(key);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -