import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.ResourceBundle;
/**
*
* <b>Application name:</b><br>
* <b>Application describing:</b> <br>
*/
public class PropertiesUtil
{
/**
*
* {读取项目中的properties配置文件}<br>
* 返回的是ResourceBundle的对象
*
* @param propertiesPath
* @return
*/
public static ResourceBundle readFromProject(String propertiesFilePath)
{
return ResourceBundle.getBundle(propertiesFilePath);
}
/**
*
* {读取磁盘上的properties配置文件}<br>
* 返回的市Properties的对象
* @param propertiesFilePath
* @return
*/
public static Properties readFromSystemFile(String propertiesFilePath)
{
InputStream is = null;
java 读取项目中的和磁盘上的properties文件
最新推荐文章于 2022-08-14 15:57:30 发布