Reading and Writing a Properties File(From Sun)
// Read properties file.
Properties properties = new Properties();
try {
properties.load(new FileInputStream(
"infilename"));
} catch (IOException e) {
}
// Write properties file.
try {
properties.store(new FileOutputStream(
"outfilename"), null);
} catch (IOException e) {
}
Here is an example of the contents of a properties file:
# a comment
! a comment
a = a string
b = a string with escape sequences \t
\n \r \\ \" \' \ (space) \u0123
c = a string with a continuation line \
contination line
d.e.f = another string
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论