Re: Copy a ZipEntry into another zip file

2014-12-15 Thread Xueming Shen
On 12/14/14 7:43 PM, Wang Weijun wrote: Several questions: 1. Why cannot I just call os.putNextEntry(ze) or at least os.putNextEntry(new ZipEntry(ze))? Maybe some fields (say, compressed size) should not be copied over? If ze2 must be this way, shall I also copy the flag field? It's the choi

Copy a ZipEntry into another zip file

2014-12-14 Thread Wang Weijun
Hi Sherman The jarsigner tool contains these 2 methods to copy a ZipEntry into the signer jar: private void writeEntry(ZipFile zf, ZipOutputStream os, ZipEntry ze) throws IOException { ZipEntry ze2 = new ZipEntry(ze.getName()); ze2.setMethod(ze.getMethod()); ze2.setTime(ze.getTime())