Package org.apache.wiki.providers
Class WikiAttachmentAdapterProvider
- java.lang.Object
- 
- org.apache.wiki.providers.WikiAttachmentAdapterProvider
 
- 
- All Implemented Interfaces:
- AttachmentProvider,- WikiProvider
 
 @Deprecated public class WikiAttachmentAdapterProvider extends java.lang.Object implements AttachmentProvider Deprecated.adapted provider should useAttachmentProviderinstead.This provider ensures backward compatibility with attachment providers not using the public API. As providers should use the public API directly, the use of this class is considered deprecated.- See Also:
- AttachmentProvider
 
- 
- 
Field Summary- 
Fields inherited from interface org.apache.wiki.api.providers.AttachmentProviderPROP_STORAGEDIR
 - 
Fields inherited from interface org.apache.wiki.api.providers.WikiProviderLATEST_VERSION
 
- 
 - 
Constructor SummaryConstructors Constructor Description WikiAttachmentAdapterProvider()Deprecated.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddeleteAttachment(Attachment att)Deprecated.Removes an entire page from the repository.voiddeleteVersion(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.InputStreamgetAttachmentData(Attachment att)Deprecated.Get attachment data.AttachmentgetAttachmentInfo(Page page, java.lang.String name, int version)Deprecated.Returns info about an attachment.java.lang.StringgetProviderInfo()Deprecated.Return a valid HTML string for information.java.util.List<Attachment>getVersionHistory(Attachment att)Deprecated.Returns version history.voidinitialize(Engine engine, java.util.Properties properties)Deprecated.Initializes the page provider.java.util.List<Attachment>listAllChanged(java.util.Date timestamp)Deprecated.Lists changed attachments since given date.java.util.List<Attachment>listAttachments(Page page)Deprecated.Lists all attachments attached to a page.voidmoveAttachmentsForPage(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.voidputAttachmentData(Attachment att, java.io.InputStream data)Deprecated.Put new attachment data.
 
- 
- 
- 
Constructor Detail- 
WikiAttachmentAdapterProviderpublic WikiAttachmentAdapterProvider() Deprecated.
 
- 
 - 
Method Detail- 
initializepublic void initialize(Engine engine, java.util.Properties properties) throws NoRequiredPropertyException, java.io.IOException Deprecated.Initializes the page provider.- Specified by:
- initializein interface- WikiProvider
- Parameters:
- engine- Engine to own this provider
- properties- A set of properties used to initialize this provider
- Throws:
- NoRequiredPropertyException- If the provider needs a property which is not found in the property set
- java.io.IOException- If there is an IO problem
 
 - 
getProviderInfopublic java.lang.String getProviderInfo() Deprecated.Return a valid HTML string for information. May be anything.- Specified by:
- getProviderInfoin interface- WikiProvider
- Returns:
- A string describing the provider.
 
 - 
putAttachmentDatapublic void putAttachmentData(Attachment att, java.io.InputStream data) throws ProviderException, java.io.IOException Deprecated.Put new attachment data.- Specified by:
- putAttachmentDatain interface- AttachmentProvider
- Parameters:
- att- Attachment object to add new data to
- data- The stream from which the provider should read the data
- Throws:
- ProviderException- If there are other errors.
- java.io.IOException- If writing fails
 
 - 
getAttachmentDatapublic java.io.InputStream getAttachmentData(Attachment att) throws ProviderException, java.io.IOException Deprecated.Get attachment data.- Specified by:
- getAttachmentDatain interface- AttachmentProvider
- Parameters:
- att- The attachment
- Returns:
- An InputStream which you contains the raw data of the object. It's your responsibility to close it.
- Throws:
- ProviderException- If the attachment cannot be found
- java.io.IOException- If the attachment cannot be opened
 
 - 
listAttachmentspublic java.util.List<Attachment> listAttachments(Page page) throws ProviderException Deprecated.Lists all attachments attached to a page.- Specified by:
- listAttachmentsin interface- AttachmentProvider
- Parameters:
- page- The page to list the attachments from.
- Returns:
- A collection of Attachment objects. May be empty, but never null.
- Throws:
- ProviderException- If something goes wrong when listing the attachments.
 
 - 
findAttachmentspublic java.util.Collection<Attachment> findAttachments(QueryItem[] query) Deprecated.Finds attachments based on the query.- Specified by:
- findAttachmentsin interface- AttachmentProvider
- Parameters:
- query- An array of QueryItem objects to search for
- Returns:
- A Collection of Attachment objects. May be empty, but never null.
 
 - 
listAllChangedpublic java.util.List<Attachment> listAllChanged(java.util.Date timestamp) throws ProviderException Deprecated.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); - Specified by:
- listAllChangedin interface- AttachmentProvider
- Parameters:
- timestamp- List all files from this date onward.
- Returns:
- A List of Attachment objects, in most-recently-changed first order.
- Throws:
- ProviderException- If something goes wrong.
 
 - 
getAttachmentInfopublic Attachment getAttachmentInfo(Page page, java.lang.String name, int version) throws ProviderException Deprecated.Returns info about an attachment.- Specified by:
- getAttachmentInfoin interface- AttachmentProvider
- Parameters:
- page- The parent page
- name- The name of the attachment
- version- The version of the attachment (it's okay to use WikiPage.LATEST_VERSION to find the latest one)
- Returns:
- An attachment object
- Throws:
- ProviderException- If the attachment cannot be found or some other error occurs.
 
 - 
getVersionHistorypublic java.util.List<Attachment> getVersionHistory(Attachment att) Deprecated.Returns version history. Each element should be an Attachment.- Specified by:
- getVersionHistoryin interface- AttachmentProvider
- Parameters:
- att- The attachment for which to find the version history for.
- Returns:
- A List of Attachment objects.
 
 - 
deleteVersionpublic void deleteVersion(Attachment att) throws ProviderException Deprecated.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.- Specified by:
- deleteVersionin interface- AttachmentProvider
- Parameters:
- att- Attachment to be removed. The version field is checked, and thus only that version is removed.
- Throws:
- ProviderException- If the attachment cannot be removed for some reason.
 
 - 
deleteAttachmentpublic void deleteAttachment(Attachment att) throws ProviderException Deprecated.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.- Specified by:
- deleteAttachmentin interface- AttachmentProvider
- Parameters:
- att- Attachment to delete.
- Throws:
- ProviderException- If the page could not be removed for some reason.
 
 - 
moveAttachmentsForPagepublic void moveAttachmentsForPage(java.lang.String oldParent, java.lang.String newParent) throws ProviderException Deprecated.Move all the attachments for a given page so that they are attached to a new page.- Specified by:
- moveAttachmentsForPagein interface- AttachmentProvider
- Parameters:
- oldParent- Name of the page we are to move the attachments from.
- newParent- Name of the page we are to move the attachments to.
- Throws:
- ProviderException- If the attachments could not be moved for some reason.
 
 
- 
 
-