public void updateContentArchive(XWikiContext context) throws XWikiException { if (this.attachment_content == null) { return; } // XWikiAttachmentArchive no longer uses the byte array passed as it's first parameter making it redundant. loadArchive(context).updateArchive(null, context); }
/** * Get the archive, loading it from the database if necessary. * * @param context the XWikiContext for the request used to load the correct attachment * archive from the database. * @return a byte array representation of a JRCS archive. * @throws XWikiException if anything goes wrong. */ public byte[] getArchive(final XWikiContext context) throws XWikiException { if (this.archive == null) { if (context != null) { updateArchive(this.attachment.getContent(context), context); } } if (this.archive == null) { return new byte[0]; } else { return this.archive.toByteArray(); } }
archive.updateArchive(context);