【发布时间】:2013-04-23 14:13:29
【问题描述】:
当我向文件添加新的UserDefinedFileAttributeView 属性时,Java 将这些信息存储在哪里?
目录中没有其他文件,查看文件属性时该文件没有任何新属性或细节。
我的代码:
String versionAttrName = "report.version";
try {
Path path = FileSystems.getDefault().getPath(filePath, "");
UserDefinedFileAttributeView view = Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);
view.write(versionAttrName, Charset.defaultCharset().encode(newVersion));
} catch (IOException e) {
System.out.println("7 - Error saving version to file! - "+ filePath + " - " + e.getMessage());
}
【问题讨论】:
-
你检查你的用户目录和
programdata目录了吗...我建议你做一个硬盘搜索,这将是找到文件的最快方法:) -
对要搜索的内容有什么想法吗?哈哈,我不知道 Java 会使用什么文件名/类型