Properties中获取指定index的value:
public class PropertiesDeal {
public static String getURL(String proName , String index) throws IOException
{
String URL = null;
InputStream inputStream = null;
try
{
inputStream = PropertiesDeal.class.getClassLoader().getResourceAsStream(proName);
Properties properties = new Properties();
properties.load(inputStream);
URL = properties.getProperty(index);
}
catch (IOException e)
{
e.printStackTrace();
}
finally
{
if (null != inputStream)
{
inputStream.close();
}
}
return URL;
}
}