Class AttachmentUrlParser
java.lang.Object
com.atlassian.confluence.servlet.download.AttachmentUrlParser
A URL parser for attachments (including thumbnails).
See
FileServerServlet for URL prefix constants.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttachment(String urlPath, String urlPrefix, Map parameters) Gets the attachment based on the url, prefix and query parameters.getAttachmentFileName(String urlPath) Gets the entity that the attachment is attached to based on the given url.longgetEntityId(String urlPath, String prefix) Gets the entity id that the attachment is attached to based on the given url.voidsetAttachmentManager(AttachmentManager attachmentManager) voidsetContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao) voidsetPageManager(PageManager pageManager)
-
Field Details
-
VERSION_PARAMETER
- See Also:
-
MODIFICATION_DATE_PARAMETER
- See Also:
-
-
Constructor Details
-
AttachmentUrlParser
public AttachmentUrlParser()
-
-
Method Details
-
getAttachment
Gets the attachment based on the url, prefix and query parameters.- Parameters:
urlPath- the attachment url pathurlPrefix- the url prefix up to the entity idparameters- query parameters from the url- Returns:
- an Attachment object, or null if the urlPath did not match an attachment
-
getEntity
Gets the entity that the attachment is attached to based on the given url. If the url cannot be parsed to extract the entity id, null is returned.- Parameters:
urlPath- the attachment url pathprefix- the url prefix up to the entity id
-
getEntityId
Gets the entity id that the attachment is attached to based on the given url. If the url cannot be parsed to extract the entity id, -1 is returned.- Parameters:
urlPath- the attachment url pathprefix- the url prefix up to the entity id
-
getAttachmentFileName
-
setContentEntityObjectDao
-
setAttachmentManager
-
setPageManager
-