Java Doc for WikiAttachmentProvider.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » providers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.providers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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





Method Summary
public  voiddeleteAttachment(Attachment att)
     Removes an entire page from the repository.
public  voiddeleteVersion(Attachment att)
     Removes a specific version from the repository.
public  CollectionfindAttachments(QueryItem[] query)
     Finds attachments based on the query.
Parameters:
  query - An array of QueryItem objects to search for A Collection of Attachment objects.
public  InputStreamgetAttachmentData(Attachment att)
     Get attachment data.
Parameters:
  att - The attachment An InputStream which you contains the raw data of the object.
public  AttachmentgetAttachmentInfo(WikiPage page, String name, int version)
     Returns info about an attachment.
public  ListgetVersionHistory(Attachment att)
     Returns version history.
public  ListlistAllChanged(Date timestamp)
     Lists changed attachments since given date.
public  CollectionlistAttachments(WikiPage page)
     Lists all attachments attached to a page.
Parameters:
  page - The page to list the attachments from.
public  voidmoveAttachmentsForPage(String oldParent, String newParent)
     Move all the attachments for a given page so that they are attached to a new page.
public  voidputAttachmentData(Attachment att, InputStream data)
     Put new attachment data.



Method Detail
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.



getAttachmentData
public InputStream getAttachmentData(Attachment att) throws ProviderException, IOException(Code)
Get attachment data.
Parameters:
  att - The attachment An InputStream which you contains the raw data of the object. It's yourresponsibility to close it.
throws:
  ProviderException - If the attachment cannot be found
throws:
  IOException - If the attachment cannot be opened



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.



putAttachmentData
public void putAttachmentData(Attachment att, InputStream data) throws ProviderException, IOException(Code)
Put new attachment data.
Parameters:
  att - Attachment object to add new data to
Parameters:
  data - The stream from which the provider should read the data
throws:
  IOException - If writing fails
throws:
  ProviderException - If there are other errors.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.