/** Sets the central directory part of extra fields. */ public void setCentralDirectoryExtra(byte[] b) { try { ZipExtraField[] central = ExtraFieldUtils.parse(b, false, ExtraFieldUtils.UnparseableExtraField.READ); mergeExtraFields(central, false); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } }
/** * Parses the given bytes as extra field data and consumes any unparseable data as an {@link * UnparseableExtraFieldData} instance. * * @param extra an array of bytes to be parsed into extra fields * @throws RuntimeException if the bytes cannot be parsed * @since 1.1 * @throws RuntimeException on error */ public void setExtra(byte[] extra) throws RuntimeException { try { ZipExtraField[] local = ExtraFieldUtils.parse(extra, true, ExtraFieldUtils.UnparseableExtraField.READ); mergeExtraFields(local, true); } catch (Exception e) { // actually this is not be possible as of Ant 1.8.1 throw new RuntimeException( "Error parsing extra fields for entry: " + getName() + " - " + e.getMessage(), e); } }