com.ecyrd.jspwiki.providers
Class WikiBasicAttachmentProvider
java.lang.Object
com.ecyrd.jspwiki.providers.WikiBasicAttachmentProvider
- All Implemented Interfaces:
- com.ecyrd.jspwiki.providers.WikiAttachmentProvider, com.ecyrd.jspwiki.WikiProvider
public class WikiBasicAttachmentProvider
- extends Object
- implements com.ecyrd.jspwiki.providers.WikiAttachmentProvider
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.png
The names of the directories will be URLencoded.
"attachment.properties" consists of the following items:
- 1.author = author name for version 1 (etc)
Fields inherited from interface com.ecyrd.jspwiki.WikiProvider |
LATEST_VERSION |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_STORAGEDIR
public static final String PROP_STORAGEDIR
- See Also:
- Constant Field Values
PROP_DISABLECACHE
public static final String PROP_DISABLECACHE
- See Also:
- Constant Field Values
PROPERTY_FILE
public static final String PROPERTY_FILE
- See Also:
- Constant Field Values
DIR_EXTENSION
public static final String DIR_EXTENSION
- See Also:
- Constant Field Values
ATTDIR_EXTENSION
public static final String ATTDIR_EXTENSION
- See Also:
- Constant Field Values
WikiBasicAttachmentProvider
public WikiBasicAttachmentProvider()
initialize
public void initialize(com.ecyrd.jspwiki.WikiEngine engine,
Properties properties)
throws com.ecyrd.jspwiki.NoRequiredPropertyException,
IOException
- Specified by:
initialize
in interface com.ecyrd.jspwiki.WikiProvider
- Throws:
com.ecyrd.jspwiki.NoRequiredPropertyException
IOException
getFileExtension
protected static String getFileExtension(String filename)
- Returns the file extension. For example "test.png" returns "png".
If file has no extension, will return "bin"
putAttachmentData
public void putAttachmentData(com.ecyrd.jspwiki.attachment.Attachment att,
InputStream data)
throws com.ecyrd.jspwiki.providers.ProviderException,
IOException
- Specified by:
putAttachmentData
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
IOException
getProviderInfo
public String getProviderInfo()
- Specified by:
getProviderInfo
in interface com.ecyrd.jspwiki.WikiProvider
getAttachmentFilePath
public String getAttachmentFilePath(com.ecyrd.jspwiki.attachment.Attachment att)
throws IOException,
com.ecyrd.jspwiki.providers.ProviderException
- Throws:
IOException
com.ecyrd.jspwiki.providers.ProviderException
getAttachmentData
public InputStream getAttachmentData(com.ecyrd.jspwiki.attachment.Attachment att)
throws IOException,
com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
getAttachmentData
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
IOException
com.ecyrd.jspwiki.providers.ProviderException
listAttachments
public Collection listAttachments(com.ecyrd.jspwiki.WikiPage page)
throws com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
listAttachments
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
findAttachments
public Collection findAttachments(com.ecyrd.jspwiki.QueryItem[] query)
- Specified by:
findAttachments
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
listAllChanged
public List listAllChanged(Date timestamp)
throws com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
listAllChanged
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
getAttachmentInfo
public com.ecyrd.jspwiki.attachment.Attachment getAttachmentInfo(com.ecyrd.jspwiki.WikiPage page,
String name,
int version)
throws com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
getAttachmentInfo
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
getVersionHistory
public List getVersionHistory(com.ecyrd.jspwiki.attachment.Attachment att)
- Specified by:
getVersionHistory
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
deleteVersion
public void deleteVersion(com.ecyrd.jspwiki.attachment.Attachment att)
throws com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
deleteVersion
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
deleteAttachment
public void deleteAttachment(com.ecyrd.jspwiki.attachment.Attachment att)
throws com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
deleteAttachment
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
moveAttachmentsForPage
public void moveAttachmentsForPage(String oldParent,
String newParent)
throws com.ecyrd.jspwiki.providers.ProviderException
- Specified by:
moveAttachmentsForPage
in interface com.ecyrd.jspwiki.providers.WikiAttachmentProvider
- Throws:
com.ecyrd.jspwiki.providers.ProviderException
Copyright © 2016 Silverpeas. All Rights Reserved.