public class AttachmentDownloadResourceManager extends Object implements PartialDownloadResourceManager
Constructor and Description |
---|
AttachmentDownloadResourceManager(AttachmentUrlParser attachmentUrlParser,
AttachmentManager attachmentManager,
PermissionManager permissionManager) |
Modifier and Type | Method and Description |
---|---|
Attachment |
getAttachment(ConfluenceUser user,
String resourcePath,
Map parameters,
String urlPrefix) |
PartialDownloadResourceReader |
getPartialResourceReader(ConfluenceUser user,
String resourcePath,
Map parameters,
String requestRange)
Returns a
DownloadResourceReader for part of a downloadable resource. |
DownloadResourceReader |
getResourceReader(ConfluenceUser user,
String resourcePath,
Map parameters)
Returns a
AttachmentDownloadResourceReader for retrieving attachment content. |
boolean |
matches(String resourcePath)
Returns a boolean to indicate whether the current DownloadResourceManager will know how to handle the
given resourcePath.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPartialResourceReader
getResourceReader
public AttachmentDownloadResourceManager(AttachmentUrlParser attachmentUrlParser, AttachmentManager attachmentManager, PermissionManager permissionManager)
public boolean matches(String resourcePath)
DownloadResourceManager
matches
in interface DownloadResourceManager
resourcePath
- the relative URL of the resource including the application context path. For example,
"/confluence/download/attachments/12345/temp.png".@Nonnull public DownloadResourceReader getResourceReader(@Nullable ConfluenceUser user, String resourcePath, Map parameters) throws UnauthorizedDownloadResourceException, DownloadResourceNotFoundException
AttachmentDownloadResourceReader
for retrieving attachment content. Typically used by HTML/PDF
export and attachment downloads.getResourceReader
in interface DownloadResourceManager
user
- 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 parameters for the resourceUnauthorizedDownloadResourceException
- if the user requesting the attachment content does not have the
permissions to view itDownloadResourceNotFoundException
- if the attachment content associated with the resourcePath cannot be
foundpublic Attachment getAttachment(@Nullable ConfluenceUser user, String resourcePath, Map parameters, String urlPrefix) throws DownloadResourceNotFoundException, UnauthorizedDownloadResourceException
@Nonnull public PartialDownloadResourceReader getPartialResourceReader(@Nullable ConfluenceUser user, String resourcePath, Map parameters, String requestRange) throws UnauthorizedDownloadResourceException, DownloadResourceNotFoundException, RangeNotSatisfiableException
PartialDownloadResourceManager
DownloadResourceReader
for part of a downloadable resource. Currently being used by attachment downloads
Use this method only if DownloadResourceManager.matches(String)
returns true.getPartialResourceReader
in interface PartialDownloadResourceManager
user
- the user who is retrieving the downloadable resource.resourcePath
- the relative URL of the resource including the application context path. For example,
"/confluence/download/attachments/12345/temp.png".parameters
- a map of url paramaters for the resourcerequestRange
- range of the resource as defined in RFC-2616
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.1UnauthorizedDownloadResourceException
- if the user requesting the downloadable resource does not have the
permissions to get itDownloadResourceNotFoundException
- if the downloadable resource associated with the resourcePath cannot be
foundRangeNotSatisfiableException
- if the requested range cannot be servedCopyright © 2003–2017 Atlassian. All rights reserved.