|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
| Field Summary |
| Fields inherited from interface com.ecyrd.jspwiki.WikiProvider |
LATEST_VERSION |
| Method Summary | |
void |
deleteAttachment(Attachment att)
Removes an entire page from the repository. |
void |
deleteVersion(Attachment att)
Removes a specific version from the repository. |
java.util.Collection |
findAttachments(QueryItem[] query)
Finds attachments based on the query. |
java.io.InputStream |
getAttachmentData(Attachment att)
Get attachment data. |
Attachment |
getAttachmentInfo(WikiPage page,
java.lang.String name,
int version)
Returns info about an attachment. |
java.util.List |
getVersionHistory(Attachment att)
Returns version history. |
java.util.List |
listAllChanged(java.util.Date timestamp)
Lists changed attachments since given date. |
java.util.Collection |
listAttachments(WikiPage page)
Lists all attachments attached to a page. |
void |
putAttachmentData(Attachment att,
java.io.InputStream data)
Put new attachment data. |
| Methods inherited from interface com.ecyrd.jspwiki.WikiProvider |
getProviderInfo, initialize |
| Method Detail |
public void putAttachmentData(Attachment att,
java.io.InputStream data)
throws ProviderException,
java.io.IOException
ProviderException
java.io.IOException
public java.io.InputStream getAttachmentData(Attachment att)
throws ProviderException,
java.io.IOException
ProviderException
java.io.IOException
public java.util.Collection listAttachments(WikiPage page)
throws ProviderException
ProviderExceptionpublic java.util.Collection findAttachments(QueryItem[] query)
public java.util.List 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
public Attachment getAttachmentInfo(WikiPage page,
java.lang.String name,
int version)
throws ProviderException
ProviderExceptionpublic java.util.List getVersionHistory(Attachment att)
public 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.
public void deleteAttachment(Attachment att)
throws ProviderException
att - Attachment to delete.
ProviderException - If the page could not be removed for some reason.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||