Class AttachmentUrlParser
- java.lang.Object
-
- com.atlassian.confluence.servlet.download.AttachmentUrlParser
-
public class AttachmentUrlParser extends Object
A URL parser for attachments (including thumbnails). SeeFileServerServlet
for URL prefix constants.
-
-
Field Summary
Fields Modifier and Type Field Description static String
MODIFICATION_DATE_PARAMETER
static String
VERSION_PARAMETER
-
Constructor Summary
Constructors Constructor Description AttachmentUrlParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Attachment
getAttachment(String urlPath, String urlPrefix, Map parameters)
Gets the attachment based on the url, prefix and query parameters.String
getAttachmentFileName(String urlPath)
ContentEntityObject
getEntity(String urlPath, String prefix)
Gets the entity that the attachment is attached to based on the given url.long
getEntityId(String urlPath, String prefix)
Gets the entity id that the attachment is attached to based on the given url.void
setAttachmentManager(AttachmentManager attachmentManager)
void
setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
void
setPageManager(PageManager pageManager)
-
-
-
Field Detail
-
VERSION_PARAMETER
public static final String VERSION_PARAMETER
- See Also:
- Constant Field Values
-
MODIFICATION_DATE_PARAMETER
public static final String MODIFICATION_DATE_PARAMETER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAttachment
public Attachment getAttachment(String urlPath, String urlPrefix, Map parameters)
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
public ContentEntityObject getEntity(String urlPath, String prefix)
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
public long getEntityId(String urlPath, String prefix)
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
-
setContentEntityObjectDao
public void setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
-
setAttachmentManager
public void setAttachmentManager(AttachmentManager attachmentManager)
-
setPageManager
public void setPageManager(PageManager pageManager)
-
-