I have the following java code to create a zip file. The file works fine on linux, but the core component of Windows XP blocks it. A workaround recommended (go to file properties and unlock) also does not work. I read about similar issues on the Internet and a similar stackoverflow post about this, but none of these solutions work for me. Any ideas on what might cause the problem.
ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
ZipOutputStream zipFile = new ZipOutputStream(byteOut);
loop {
byte [] tempData = "some data".getBytes("UTF-8");
ZipEntry entry = new ZipEntry("blah.txt");
entry.setSize(tempData.length);
entry.setTime((new Date()).getTime());
zipFile.putNextEntry(entry);
zipFile.write(tempData);
zipFile.closeEntry();
}
zipFile.close();
PS
- I do not have window protector on my windows machine.
- I tried to set the record size in zip and still not working.
- The absolute path is not specified in the zip entry, and there are no slashes in the path.
Thank!
1. , Windows XP . 7zip, , . - , , .
2. Windows, : "Windows , ". , : "Windows , . ". ( → ), .