ZIP problem on Netware

Below there is a program which updates an OpenOffice file, in fact a zip file.

It works fine on window but on Netware I receive an exception

java.util.zip.ZipException: invalid entry CRC-32

(expected oxffffffffc0f3d518 but got 0xc0f3d518)

Any ideas is great appreciated. Thanks!

(JDK 1.4.2 on both OS)

================

import java.io.*;

import java.util.*;

import java.util.zip.*;

import java.util.jar.*;

class test {

public static void main(String []args){

test ob=new test();

ob.updateZipEntry("data://test.sxw","content.xml","data:");

}

void updateZipEntry(String jarName, String fileName, String location){

try {

File jarFile = new File(jarName);

File tempJarFile = new File(jarName + ".tmp");

JarFile jar = new JarFile(jarFile);

boolean jarUpdated = false;

try {

Manifest jarManifest = jar.getManifest();

JarOutputStream tempJar = new JarOutputStream(new FileOutputStream(tempJarFile));

byte[] buffer = new byte[1024];

int bytesRead;

try {

FileInputStream file = new FileInputStream(location+"//"+fileName);

try {

JarEntry entry = new JarEntry(fileName);

tempJar.putNextEntry(entry);

while ((bytesRead = file.read(buffer)) != -1) {

tempJar.write(buffer, 0, bytesRead);

}

}

finally { file.close(); }

for (Enumeration entries = jar.entries(); entries.hasMoreElements(); ) {

JarEntry entry = (JarEntry) entries.nextElement();

if (! entry.getName().equals(fileName)) {

InputStream entryStream = jar.getInputStream(entry);

tempJar.putNextEntry(entry);

while ((bytesRead = entryStream.read(buffer)) != -1) {

tempJar.write(buffer, 0, bytesRead);

}

}

}

jarUpdated = true;

}

catch (Exception ex) {

System.out.println(ex);

tempJar.putNextEntry(new JarEntry("stub"));

}

finally { tempJar.close(); }

}

finally {

jar.close();

if (! jarUpdated) { tempJarFile.delete(); }

}

if (jarUpdated) {

jarFile.delete();

tempJarFile.renameTo(jarFile);

}

} catch(IOException e) {}

} // end updateZipEntry

}

[2311 byte] By [DanCrintea] at [2007-9-30 9:55:40]
# 1
Forum: J2EE PortabilityThis forum discusses issues related to writing portable J2EE applications including verifying correct API use, using Sun's Java Application Verification Kit, and strategies for preventing platform lock in.
bbritta at 2007-7-3 15:01:50 > top of Java-index,Enterprise & Remote Computing,AVK Portability...