【发布时间】:2015-10-29 13:47:03
【问题描述】:
我有一个压缩文件File filepath = new File("c:/template.zip)。我在c:/template.zip/template/name.txt 里面有一个name.txt。我需要更新name.txt 的内容。我尝试了下面的代码,但我没有更新它。
try {
FileUtils.writeStringToFile(filepath, "hi", false);
}catch (IOException e) {
e.printStackTrace();
}
【问题讨论】:
-
你不能写入.zip文件,你必须提取zipentry(文件)然后写入它然后压缩它。
标签: java