Java 属性类附加日期

标签 java file-io configuration-files

我正在使用 java 属性类通过此代码将值附加到我的配置文件。(我删除了错误处理等)

Properties configFile = new Properties();
configFile.setProperty(key, value);
configFile.store(new FileOutputStream("plugins/WirelessRedstone/receivers.properties", true), null);

当我附加键值对时,当前日期和时间会添加到我的键值对之前。示例#Thu May 26 03:39:59 EDT 2011

我怎样才能停止它?

非常感谢,乔达梅里奥

最佳答案

根据属性中存储方法的 Java 文档..它总是写该行

Next, a comment line is always written, consisting of an ASCII # character, the current date and time (as if produced by the toString method of Date for the current time), and a line separator as generated by the Writer.

您可以为此编写自己的存储方法。

关于Java 属性类附加日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6135305/

相关文章:

java - 如何管理不同应用实例的属性文件?

java - 无法在 linux 上安装 rjb1.4.9 指出未设置 java_home

azure - 如何从 Azure 函数返回 xlsx 文件?

java - Spring 安全: Add custom message for authentication failure ( "Bad Credentials" to "Invalid Credentials")

arrays - 在 MATLAB 中将混合数据元胞数组保存到 ascii 文件

c++ - wifstream相当于_wfopen的 "mode"参数?

linux - Linux 上外部 Web (Grails) 应用程序配置文件的标准位置

configuration-files - 输入 LDAP 密码一直说 ldap_bind : Invalid credentials (49)

java - 我可以在不使类泛型的情况下使构造函数泛型吗?

java - 使用游戏中的对象创建子弹