This commit is contained in:
Johnny Lim
2016-12-21 14:51:42 -08:00
committed by Phillip Webb
parent 4aac1e3f90
commit e12b4a944f
10 changed files with 18 additions and 19 deletions

View File

@@ -55,15 +55,15 @@ public class AbstractExecutableArchiveLauncherTests {
jarOutputStream.putNextEntry(new JarEntry(entryPrefix + "/"));
jarOutputStream.putNextEntry(new JarEntry(entryPrefix + "/classes/"));
jarOutputStream.putNextEntry(new JarEntry(entryPrefix + "/lib/"));
JarEntry webInfLibFoo = new JarEntry(entryPrefix + "/lib/foo.jar");
webInfLibFoo.setMethod(ZipEntry.STORED);
JarEntry libFoo = new JarEntry(entryPrefix + "/lib/foo.jar");
libFoo.setMethod(ZipEntry.STORED);
ByteArrayOutputStream fooJarStream = new ByteArrayOutputStream();
new JarOutputStream(fooJarStream).close();
webInfLibFoo.setSize(fooJarStream.size());
libFoo.setSize(fooJarStream.size());
CRC32 crc32 = new CRC32();
crc32.update(fooJarStream.toByteArray());
webInfLibFoo.setCrc(crc32.getValue());
jarOutputStream.putNextEntry(webInfLibFoo);
libFoo.setCrc(crc32.getValue());
jarOutputStream.putNextEntry(libFoo);
jarOutputStream.write(fooJarStream.toByteArray());
jarOutputStream.close();
return archive;