AttachmentProvider instead@Deprecated public interface WikiAttachmentProvider extends WikiProvider
The difference between this class and WikiPageProvider is that there PageProviders handle Unicode text, whereas we handle binary data. While there are quite a lot of similarities in how we handle things, many providers can really use just one. In addition, since binary files can be really large, we rely on Input/OutputStreams.
AttachmentProviderLATEST_VERSION| Modifier and Type | Method and Description |
|---|---|
void |
deleteAttachment(Attachment att)
Deprecated.
Removes an entire page from the repository.
|
void |
deleteVersion(Attachment att)
Deprecated.
Removes a specific version from the repository.
|
java.util.Collection<Attachment> |
findAttachments(QueryItem[] query)
Deprecated.
Finds attachments based on the query.
|
java.io.InputStream |
getAttachmentData(Attachment att)
Deprecated.
Get attachment data.
|
Attachment |
getAttachmentInfo(WikiPage page,
java.lang.String name,
int version)
Deprecated.
Returns info about an attachment.
|
java.util.List<Attachment> |
getVersionHistory(Attachment att)
Deprecated.
Returns version history.
|
java.util.List<Attachment> |
listAllChanged(java.util.Date timestamp)
Deprecated.
Lists changed attachments since given date.
|
java.util.List<Attachment> |
listAttachments(WikiPage page)
Deprecated.
Lists all attachments attached to a page.
|
void |
moveAttachmentsForPage(java.lang.String oldParent,
java.lang.String newParent)
Deprecated.
Move all the attachments for a given page so that they are attached to a new page.
|
void |
putAttachmentData(Attachment att,
java.io.InputStream data)
Deprecated.
Put new attachment data.
|
initialize, initializegetProviderInfovoid putAttachmentData(Attachment att, java.io.InputStream data) throws ProviderException, java.io.IOException
att - Attachment object to add new data todata - The stream from which the provider should read the datajava.io.IOException - If writing failsProviderException - If there are other errors.java.io.InputStream getAttachmentData(Attachment att) throws ProviderException, java.io.IOException
att - The attachmentProviderException - If the attachment cannot be foundjava.io.IOException - If the attachment cannot be openedjava.util.List<Attachment> listAttachments(WikiPage page) throws ProviderException
page - The page to list the attachments from.ProviderException - If something goes wrong when listing the attachments.java.util.Collection<Attachment> findAttachments(QueryItem[] query)
query - An array of QueryItem objects to search forjava.util.List<Attachment> listAllChanged(java.util.Date timestamp) throws ProviderException
This is different from WikiPageProvider, where you basically get a list of all pages, then sort them locally. However, since some providers can be more efficient in locating recently changed files (like any database) than our non-optimized Java code, it makes more sense to fetch the whole list this way.
To get all files, call this with Date(0L);
timestamp - List all files from this date onward.ProviderException - If something goes wrong.Attachment getAttachmentInfo(WikiPage page, java.lang.String name, int version) throws ProviderException
page - The parent pagename - The name of the attachmentversion - The version of the attachment (it's okay to use WikiPage.LATEST_VERSION to find the latest one)ProviderException - If the attachment cannot be found or some other error occurs.java.util.List<Attachment> getVersionHistory(Attachment att)
att - The attachment for which to find the version history for.void deleteVersion(Attachment att) throws ProviderException
att - Attachment to be removed. The version field is checked, and thus only that version is removed.ProviderException - If the attachment cannot be removed for some reason.void deleteAttachment(Attachment att) throws ProviderException
att - Attachment to delete.ProviderException - If the page could not be removed for some reason.void moveAttachmentsForPage(java.lang.String oldParent, java.lang.String newParent) throws ProviderException
oldParent - Name of the page we are to move the attachments from.newParent - Name of the page we are to move the attachments to.ProviderException - If the attachments could not be moved for some reason.Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.