com.atlassian.confluence.importexport.resource
Class AttachmentDownloadResourceManager

java.lang.Object
  extended by com.atlassian.confluence.importexport.resource.AttachmentDownloadResourceManager
All Implemented Interfaces:
DownloadResourceManager
Direct Known Subclasses:
ThumbnailDownloadResourceManager

public class AttachmentDownloadResourceManager
extends java.lang.Object
implements DownloadResourceManager


Constructor Summary
AttachmentDownloadResourceManager()
           
 
Method Summary
protected  Attachment getAttachment(java.lang.String userName, java.lang.String resourcePath, java.util.Map parameters, java.lang.String urlPrefix)
           
 DownloadResourceReader getResourceReader(java.lang.String userName, java.lang.String resourcePath, java.util.Map parameters)
          Returns a AttachmentDownloadResourceReader for retrieving attachment content.
 boolean matches(java.lang.String resourcePath)
          Returns a boolean to indicate whether the current DownloadResourceManager will know how to handle the given resourcePath.
 void setAttachmentManager(AttachmentManager attachmentManager)
           
 void setAttachmentUrlParser(AttachmentUrlParser attachmentUrlParser)
           
 void setPermissionManager(PermissionManager permissionManager)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentDownloadResourceManager

public AttachmentDownloadResourceManager()
Method Detail

matches

public boolean matches(java.lang.String resourcePath)
Description copied from interface: DownloadResourceManager
Returns a boolean to indicate whether the current DownloadResourceManager will know how to handle the given resourcePath.

Specified by:
matches in interface DownloadResourceManager
Parameters:
resourcePath - the relative URL of the resource including the application context path. For example, "/confluence/download/attachments/12345/temp.png".
Returns:
true if the manager can handle the given resource path

getResourceReader

public DownloadResourceReader getResourceReader(java.lang.String userName,
                                                java.lang.String resourcePath,
                                                java.util.Map parameters)
                                         throws UnauthorizedDownloadResourceException,
                                                DownloadResourceNotFoundException
Returns a AttachmentDownloadResourceReader for retrieving attachment content. Typically used by HTML/PDF export and attachment downloads.

Specified by:
getResourceReader in interface DownloadResourceManager
Parameters:
userName - the user who is retrieving the attachment content.
resourcePath - the relative URL of the resource including the application context path. For example, "/confluence/download/thumbnails/12345/temp.png".
parameters - a map of url paramaters for the resource
Returns:
a DownloadResourceReader to read the resource content from
Throws:
UnauthorizedDownloadResourceException - if the user requesting the attachment content does not have the permissions to view it
DownloadResourceNotFoundException - if the attachment content associated with the resourcePath cannot be found

getAttachment

protected Attachment getAttachment(java.lang.String userName,
                                   java.lang.String resourcePath,
                                   java.util.Map parameters,
                                   java.lang.String urlPrefix)
                            throws DownloadResourceNotFoundException,
                                   UnauthorizedDownloadResourceException
Throws:
DownloadResourceNotFoundException
UnauthorizedDownloadResourceException

setAttachmentUrlParser

public void setAttachmentUrlParser(AttachmentUrlParser attachmentUrlParser)

setAttachmentManager

public void setAttachmentManager(AttachmentManager attachmentManager)

setPermissionManager

public void setPermissionManager(PermissionManager permissionManager)

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)


Copyright © 2003-2014 Atlassian. All Rights Reserved.