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); }
public XWikiAttachment getAttachmentRevision(String rev, XWikiContext context) throws XWikiException { if (StringUtils.equals(rev, this.getVersion())) { return this; } return loadArchive(context).getRevision(this, rev, context); }
/** * @return a list of string with all the versions number in String * @throws XWikiException */ public List<Version> getVersionList() throws XWikiException { this.attachment.loadArchive(getXWikiContext()); return this.attachment.getVersionList(); }
public void loadAttachments(XWikiContext context) throws XWikiException { for (XWikiAttachment attachment : getAttachmentList()) { attachment.loadContent(context); attachment.loadArchive(context); } }
public Version[] getVersions() throws XWikiException { this.attachment.loadArchive(getXWikiContext()); return this.attachment.getVersions(); }
/** * The Constructor. * * @param deleted the deleted attachment. * @param provider a means of gettign the files used for storing the attachment. * @param fileTools tools for getting file locks and backup/temporary files. * @param deletedAttachmentSerializer a Serializer to serialize a DeletedAttachment. * @param versionSerializer a Serializer which will serialize a list of XWikiAttachment objects. * @param context the legacy XWikiContext which might be needed to get the attachment archive. * @throws XWikiException if loading the attachment content or archive fails. */ SaveDeletedAttachmentContentRunnable(final XWikiAttachment attachment, final DeletedAttachmentFileProvider provider, final FilesystemStoreTools fileTools, final Serializer<XWikiAttachment, XWikiAttachment> metaSerializer, final Serializer<List<XWikiAttachment>, List<XWikiAttachment>> versionSerializer, final XWikiContext context) throws XWikiException { // Save metadata about the deleted attachment. final StreamProvider metaProvider = new SerializationStreamProvider<XWikiAttachment>(metaSerializer, attachment); addSaver(metaProvider, fileTools, provider.getDeletedAttachmentMetaFile()); // Save the archive for the deleted attachment. final XWikiAttachmentArchive archive = attachment.loadArchive(context); if (archive == null) { throw new NullPointerException("Failed to load attachment archive, loadArchive() returned null"); } new AttachmentArchiveSaveRunnable(archive, fileTools, provider, versionSerializer, context).runIn(this); // Save the attachment's content. final StreamProvider contentProvider = new AttachmentContentStreamProvider(attachment, context); this.addSaver(contentProvider, fileTools, provider.getAttachmentContentFile()); }
archive = attachment.loadArchive(xcontext); if (archive != null) { attachmentParameters.put(XWikiWikiAttachmentFilter.PARAMETER_JRCSREVISIONS,
final XWikiAttachmentArchive archive = attachment.loadArchive(context); if (archive == null) { throw new NullPointerException("Failed to load attachment archive, "
favs.getArchiveDeleteRunnable(attachment.loadArchive(context)).runIn(this); } else { new TransactionRunnable<HibernateTransaction>()
favs.getArchiveDeleteRunnable(attachment.loadArchive(context)).runIn(this); } else { new TransactionRunnable<HibernateTransaction>()
attachment.loadArchive(context);
XWikiAttachmentArchive aarchive = loadArchive(context); if (aarchive != null) { el = new DOMElement("versions");