Package org.apache.wiki.providers
Class BasicAttachmentProvider
java.lang.Object
org.apache.wiki.providers.BasicAttachmentProvider
- All Implemented Interfaces:
AttachmentProvider
,WikiProvider
Provides basic, versioning attachments.
Structure is as follows: attachment_dir/ ThisPage/ attachment.doc/ attachment.properties 1.doc 2.doc 3.doc picture.png/ attachment.properties 1.png 2.png ThatPage/ picture.png/ attachment.properties 1.pngThe names of the directories will be URLencoded.
"attachment.properties" consists of the following items:
- 1.author = author name for version 1 (etc)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Returns only those directories that contain attachments.static class
Accepts only files that are actual versions, no control files. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The default extension for the attachment directory.static final String
The default extension for the page attachment directory name.static final String
The property name for specifying which attachments are not cached.static final String
The name of the property file.Fields inherited from interface org.apache.wiki.api.providers.AttachmentProvider
PROP_STORAGEDIR
Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
deleteVersion
(Attachment att) findAttachments
(QueryItem[] query) getAttachmentInfo
(Page page, String name, int version) protected static String
getFileExtension
(String filename) Returns the file extension.void
initialize
(Engine engine, Properties properties) listAllChanged
(Date timestamp) listAttachments
(Page page) void
moveAttachmentsForPage
(String oldParent, String newParent) void
putAttachmentData
(Attachment att, InputStream data)
-
Field Details
-
PROP_DISABLECACHE
The property name for specifying which attachments are not cached. Value is "jspwiki.basicAttachmentProvider.disableCache".- See Also:
-
PROPERTY_FILE
The name of the property file.- See Also:
-
DIR_EXTENSION
The default extension for the page attachment directory name.- See Also:
-
ATTDIR_EXTENSION
The default extension for the attachment directory.- See Also:
-
-
Constructor Details
-
BasicAttachmentProvider
public BasicAttachmentProvider()
-
-
Method Details
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException - Specified by:
initialize
in interfaceWikiProvider
- Throws:
NoRequiredPropertyException
IOException
-
getFileExtension
Returns the file extension. For example "test.png" returns "png".If file has no extension, will return "bin"
- Parameters:
filename
- The file name to check- Returns:
- The extension. If no extension is found, returns "bin".
-
putAttachmentData
public void putAttachmentData(Attachment att, InputStream data) throws ProviderException, IOException - Specified by:
putAttachmentData
in interfaceAttachmentProvider
- Throws:
ProviderException
IOException
-
getProviderInfo
- Specified by:
getProviderInfo
in interfaceWikiProvider
-
getAttachmentData
- Specified by:
getAttachmentData
in interfaceAttachmentProvider
- Throws:
IOException
ProviderException
-
listAttachments
- Specified by:
listAttachments
in interfaceAttachmentProvider
- Throws:
ProviderException
-
findAttachments
- Specified by:
findAttachments
in interfaceAttachmentProvider
-
listAllChanged
- Specified by:
listAllChanged
in interfaceAttachmentProvider
- Throws:
ProviderException
-
getAttachmentInfo
- Specified by:
getAttachmentInfo
in interfaceAttachmentProvider
- Throws:
ProviderException
-
getVersionHistory
- Specified by:
getVersionHistory
in interfaceAttachmentProvider
-
deleteVersion
- Specified by:
deleteVersion
in interfaceAttachmentProvider
- Throws:
ProviderException
-
deleteAttachment
- Specified by:
deleteAttachment
in interfaceAttachmentProvider
- Throws:
ProviderException
-
moveAttachmentsForPage
- Specified by:
moveAttachmentsForPage
in interfaceAttachmentProvider
- Throws:
ProviderException
-