public Archive getNestedArchive(Entry entry) throws IOException { JarEntry jarEntry = ((JarFileEntry) entry).getJarEntry(); if (jarEntry.getComment() != null && jarEntry.getComment().startsWith(UNPACK_MARKER)) { return getUnpackedNestedArchive(jarEntry); } try { JarFile jarFile = this.jarFile.getNestedJarFile(jarEntry); return new JarFileArchive(jarFile); } catch (Exception ex) { throw new IllegalStateException("Failed to get nested archive for entry " + entry.getName(), ex); } }
protected JarEntry createEntry(JarEntry rootEntry, JarEntry template) { if(rootEntry == null) return new JarEntry(template); String name = template.getName().substring(rootEntry.getName().length()); JarEntry entry = new JarEntry(name); entry.setComment(template.getComment()); entry.setSize(template.getSize()); entry.setTime(template.getTime()); return entry; }
public Archive getNestedArchive(Entry entry) throws IOException { JarEntry jarEntry = ((JarFileEntry) entry).getJarEntry(); if (jarEntry.getComment() != null && jarEntry.getComment().startsWith(UNPACK_MARKER)) { return getUnpackedNestedArchive(jarEntry); } try { JarFile jarFile = this.jarFile.getNestedJarFile(jarEntry); return new JarFileArchive(jarFile); } catch (Exception ex) { throw new IllegalStateException("Failed to get nested archive for entry " + entry.getName(), ex); } }
protected Archive getNestedArchive(Entry entry) throws IOException { JarEntry jarEntry = ((JarFileEntry) entry).getJarEntry(); if (jarEntry.getComment().startsWith(UNPACK_MARKER)) { return getUnpackedNestedArchive(jarEntry); } try { JarFile jarFile = this.jarFile.getNestedJarFile(jarEntry); return new JarFileArchive(jarFile); } catch (Exception ex) { throw new IllegalStateException("Failed to get nested archive for entry " + entry.getName(), ex); } } private Archive getUnpackedNestedArchive(JarEntry jarEntry) throws IOException {
protected Archive getNestedArchive(Entry entry) throws IOException { JarEntry jarEntry = ((JarFileEntry) entry).getJarEntry(); if (jarEntry.getComment().startsWith(UNPACK_MARKER)) { return getUnpackedNestedArchive(jarEntry); } try { JarFile jarFile = this.jarFile.getNestedJarFile(jarEntry); return new JarFileArchive(jarFile); } catch (Exception ex) { throw new IllegalStateException( "Failed to get nested archive for entry " + entry.getName(), ex); } }
newEntry.setMethod(oldEntry.getMethod()); newEntry.setExtra(oldEntry.getExtra()); newEntry.setComment(oldEntry.getComment());
newEntry.setMethod( oldEntry.getMethod() ); newEntry.setExtra( oldEntry.getExtra() ); newEntry.setComment( oldEntry.getComment() );
@Override public JarEntry transform(JarEntry entry) { JarEntry renamedEntry = new JarEntry(this.namePrefix + entry.getName()); renamedEntry.setTime(entry.getTime()); renamedEntry.setSize(entry.getSize()); renamedEntry.setMethod(entry.getMethod()); if (entry.getComment() != null) { renamedEntry.setComment(entry.getComment()); } renamedEntry.setCompressedSize(entry.getCompressedSize()); renamedEntry.setCrc(entry.getCrc()); //setCreationTimeIfPossible(entry, renamedEntry); if (entry.getExtra() != null) { renamedEntry.setExtra(entry.getExtra()); } return renamedEntry; }
@Override public JarEntry transform(JarEntry entry) { JarEntry renamedEntry = new JarEntry(this.namePrefix + entry.getName()); renamedEntry.setTime(entry.getTime()); renamedEntry.setSize(entry.getSize()); renamedEntry.setMethod(entry.getMethod()); if (entry.getComment() != null) { renamedEntry.setComment(entry.getComment()); } renamedEntry.setCompressedSize(entry.getCompressedSize()); renamedEntry.setCrc(entry.getCrc()); //setCreationTimeIfPossible(entry, renamedEntry); if (entry.getExtra() != null) { renamedEntry.setExtra(entry.getExtra()); } return renamedEntry; }
private static JarEntry smartClone(JarEntry originalJarEntry) { final JarEntry newJarEntry = new JarEntry(originalJarEntry.getName()); newJarEntry.setComment(originalJarEntry.getComment()); newJarEntry.setExtra(originalJarEntry.getExtra()); newJarEntry.setMethod(originalJarEntry.getMethod()); newJarEntry.setTime(originalJarEntry.getTime()); //Must set size and CRC for STORED entries if (newJarEntry.getMethod() == ZipEntry.STORED) { newJarEntry.setSize(originalJarEntry.getSize()); newJarEntry.setCrc(originalJarEntry.getCrc()); } return newJarEntry; }
/** * Get the ZipEntry for the given JarEntry. Added in order to suppress the * compressedSize field as it was causing errors * * @param je The jar entry. * @return ZipEntry with fields populated from the JarEntry. */ private static ZipEntry getZipEntry(JarEntry je) { ZipEntry ze = new ZipEntry(je.getName()); ze.setComment(je.getComment()); ze.setCrc(je.getCrc()); ze.setExtra(je.getExtra()); ze.setMethod(je.getMethod()); ze.setSize(je.getSize()); ze.setTime(je.getTime()); return ze; } }
/** * Get the ZipEntry for the given JarEntry. Added in order to suppress the * compressedSize field as it was causing errors * * @param je The jar entry. * @return ZipEntry with fields populated from the JarEntry. */ private static ZipEntry getZipEntry(JarEntry je) { ZipEntry ze = new ZipEntry(je.getName()); ze.setComment(je.getComment()); ze.setCrc(je.getCrc()); ze.setExtra(je.getExtra()); ze.setMethod(je.getMethod()); ze.setSize(je.getSize()); ze.setTime(je.getTime()); return ze; } }