final String comm = ze.getComment(); if (comm != null && !"".equals(comm)) {
zeNew.setComment(ze.getComment()); zeNew.setExtra(ze.getExtra()); zeNew.setTime(ze.getTime());
return false; String myComment = getComment(); String otherComment = other.getComment(); if (myComment == null) { myComment = "";
String comm = ze.getComment(); if (comm == null) { comm = "";
final String comm = ze.getComment(); if (comm != null && !"".equals(comm)) {
zeNew.setComment(ze.getComment()); zeNew.setExtra(ze.getExtra()); zeNew.setTime(ze.getTime());
zeNew.setComment(ze.getComment()); zeNew.setExtra(ze.getExtra()); zeNew.setTime(ze.getTime());
return false; String myComment = getComment(); String otherComment = other.getComment(); if (myComment == null) { myComment = "";
String comm = ze.getComment(); if (comm == null) { comm = "";
@Override public void writeEntry( ArchiveOutputStream archiveOutputStream, ArchiveEntry archiveEntry, @Nullable String name, ConsumerWhichThrows<? super OutputStream, ? extends IOException> writeContents ) throws IOException { if (!(archiveOutputStream instanceof ZipArchiveOutputStream)) { throw new IllegalArgumentException(archiveOutputStream.getClass().getName()); } ZipArchiveEntry nzae = new ZipArchiveEntry(name != null ? name : archiveEntry.getName()); nzae.setTime(archiveEntry.getLastModifiedDate().getTime()); if (archiveEntry instanceof ZipArchiveEntry) { ZipArchiveEntry zae = (ZipArchiveEntry) archiveEntry; nzae.setComment(zae.getComment()); nzae.setExternalAttributes(zae.getExternalAttributes()); nzae.setExtraFields(zae.getExtraFields(true)); nzae.setGeneralPurposeBit(zae.getGeneralPurposeBit()); nzae.setInternalAttributes(zae.getInternalAttributes()); nzae.setMethod(zae.getMethod()); if (nzae.isDirectory()) { nzae.setSize(0); nzae.setCrc(0); } } archiveOutputStream.putArchiveEntry(nzae); if (!archiveEntry.isDirectory()) writeContents.consume(archiveOutputStream); archiveOutputStream.closeArchiveEntry(); }
@Override public void writeEntry( ArchiveOutputStream archiveOutputStream, ArchiveEntry archiveEntry, @Nullable String name, ConsumerWhichThrows<? super OutputStream, ? extends IOException> writeContents ) throws IOException { if (!(archiveOutputStream instanceof ZipArchiveOutputStream)) { throw new IllegalArgumentException(archiveOutputStream.getClass().getName()); } ZipArchiveEntry nzae = new ZipArchiveEntry(name != null ? name : archiveEntry.getName()); nzae.setTime(archiveEntry.getLastModifiedDate().getTime()); if (archiveEntry instanceof ZipArchiveEntry) { ZipArchiveEntry zae = (ZipArchiveEntry) archiveEntry; nzae.setComment(zae.getComment()); nzae.setExternalAttributes(zae.getExternalAttributes()); nzae.setExtraFields(zae.getExtraFields(true)); nzae.setGeneralPurposeBit(zae.getGeneralPurposeBit()); nzae.setInternalAttributes(zae.getInternalAttributes()); nzae.setMethod(zae.getMethod()); if (nzae.isDirectory()) { nzae.setSize(0); nzae.setCrc(0); } } archiveOutputStream.putArchiveEntry(nzae); if (!archiveEntry.isDirectory()) writeContents.consume(archiveOutputStream); archiveOutputStream.closeArchiveEntry(); }