| com.ecyrd.jspwiki.providers.WikiAttachmentProvider
All known Subclasses: com.ecyrd.jspwiki.providers.CachingAttachmentProvider, com.ecyrd.jspwiki.providers.BasicAttachmentProvider,
WikiAttachmentProvider | public interface WikiAttachmentProvider extends WikiProvider(Code) | | Defines an attachment provider - a class which is capable of saving
binary data as attachments.
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.
author: Erik Bunn author: Janne Jalkanen |
deleteAttachment | public void deleteAttachment(Attachment att) throws ProviderException(Code) | | Removes an entire page from the repository. The implementations
should really do no more security checks, since that is the domain
of the AttachmentManager. Just delete it as efficiently as you can. You should also
delete any auxiliary files and directories that belong to this attachment,
IF they were created
by this provider.
since: 2.0.17. Parameters: att - Attachment to delete. throws: ProviderException - If the page could not be removed for some reason. |
deleteVersion | public void deleteVersion(Attachment att) throws ProviderException(Code) | | Removes a specific version from the repository. The implementations
should really do no more security checks, since that is the domain
of the AttachmentManager. Just delete it as efficiently as you can.
since: 2.0.19. Parameters: att - Attachment to be removed. The version field is checked, and thusonly that version is removed. throws: ProviderException - If the attachment cannot be removed for some reason. |
findAttachments | public Collection findAttachments(QueryItem[] query)(Code) | | Finds attachments based on the query.
Parameters: query - An array of QueryItem objects to search for A Collection of Attachment objects. May be empty, but never null. |
getAttachmentInfo | public Attachment getAttachmentInfo(WikiPage page, String name, int version) throws ProviderException(Code) | | Returns info about an attachment.
Parameters: page - The parent page Parameters: name - The name of the attachment Parameters: version - The version of the attachment (it's okay to use WikiPage.LATEST_VERSION to find the latest one) An attachment object throws: ProviderException - If the attachment cannot be found or some other error occurs. |
getVersionHistory | public List getVersionHistory(Attachment att)(Code) | | Returns version history. Each element should be
an Attachment.
Parameters: att - The attachment for which to find the version history for. A List of Attachment objects. |
listAllChanged | public List listAllChanged(Date timestamp) throws ProviderException(Code) | | Lists changed attachments since given date. Can also be used to fetch
a list of all pages.
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);
Parameters: timestamp - List all files from this date onward. A List of Attachment objects, in most-recently-changed first order. throws: ProviderException - If something goes wrong. |
listAttachments | public Collection listAttachments(WikiPage page) throws ProviderException(Code) | | Lists all attachments attached to a page.
Parameters: page - The page to list the attachments from. A collection of Attachment objects. May be empty, but never null. throws: ProviderException - If something goes wrong when listing the attachments. |
moveAttachmentsForPage | public void moveAttachmentsForPage(String oldParent, String newParent) throws ProviderException(Code) | | Move all the attachments for a given page so that they are attached to a
new page.
Parameters: oldParent - Name of the page we are to move the attachments from. Parameters: newParent - Name of the page we are to move the attachments to. throws: ProviderException - If the attachments could not be moved for somereason. |
|
|