我使用以下代码创建一个zip文件:
public static void main(String[] args) {
byte[] buffer = new byte[1024];
String inputFilepath = "./src/main/resources/email-hule.html";
String outputFilepath = "." + File.separator + "target" + File.separator + "ĐỨcNguyễn.zip";
FileOutputStream fos = null;
ZipOutputStream zos = null;
try {
fos = new FileOutputStream(outputFilepath);
zos = new ZipOutputStream(fos);
ZipEntry ze = new ZipEntry("Đức Nguyễn Văn.xml");
zos.putNextEntry(ze);
FileInputStream in = new FileInputStream(inputFilepath);
int len;
while ((len = in.read(buffer)) > 0) {
zos.write(buffer, 0, len);
}
in.close();
zos.closeEntry();
//remember close it
zos.close();
System.out.println("Done");
} catch (IOException ex) {
ex.printStackTrace();
} finally {
}
}
完整代码here
如果我用7zip打开文件
但我用Windows资源管理器打开文件 - Windows 7
我该如何纠正?
由于