@ParametersAreNonnullByDefault public class DefaultTemporaryWebAttachmentManager extends Object implements TemporaryWebAttachmentManager
Constructor and Description |
---|
DefaultTemporaryWebAttachmentManager(AttachmentManager attachmentManager,
AttachmentValidator attachmentValidator,
I18nHelper.BeanFactory beanFactory,
TemporaryWebAttachmentsMonitorLocator temporaryWebAttachmentsMonitorLocator,
ApplicationProperties applicationProperties,
TemporaryWebAttachmentFactory temporaryWebAttachmentsFactory) |
Modifier and Type | Method and Description |
---|---|
void |
clearTemporaryAttachmentsByFormToken(String formToken)
Removes all remaining temporary attachments which were created with given form token.
|
AttachmentsBulkOperationResult<ChangeItemBean> |
convertTemporaryAttachments(ApplicationUser user,
Issue issue,
List<String> temporaryAttachmentsIds)
Converts temporary attachments created by
TemporaryWebAttachmentManager.createTemporaryWebAttachment(java.io.InputStream, java.lang.String, java.lang.String, long, com.atlassian.fugue.Either<com.atlassian.jira.issue.Issue, com.atlassian.jira.project.Project>, java.lang.String, com.atlassian.jira.user.ApplicationUser)
into real attachments. |
com.atlassian.fugue.Either<AttachmentError,TemporaryWebAttachment> |
createTemporaryWebAttachment(InputStream stream,
String fileName,
String contentType,
long size,
com.atlassian.fugue.Either<Issue,Project> target,
String formToken,
ApplicationUser user)
Creates new temporary attachment that may be later converted into real attachment.
|
com.atlassian.fugue.Option<TemporaryWebAttachment> |
getTemporaryWebAttachment(String temporaryAttachmentId)
Gets temporary web attachment by string ID, which was produced by
TemporaryWebAttachment.getStringId() . |
Collection<TemporaryWebAttachment> |
getTemporaryWebAttachmentsByFormToken(String formToken)
Gets all temporary attachments associated with given form token.
|
void |
updateTemporaryWebAttachment(String temporaryAttachmentId,
TemporaryWebAttachment updated)
Updates existing temporary attachment object to new state.
|
public DefaultTemporaryWebAttachmentManager(AttachmentManager attachmentManager, AttachmentValidator attachmentValidator, I18nHelper.BeanFactory beanFactory, TemporaryWebAttachmentsMonitorLocator temporaryWebAttachmentsMonitorLocator, ApplicationProperties applicationProperties, TemporaryWebAttachmentFactory temporaryWebAttachmentsFactory)
@ParametersAreNonnullByDefault public com.atlassian.fugue.Either<AttachmentError,TemporaryWebAttachment> createTemporaryWebAttachment(InputStream stream, String fileName, String contentType, long size, com.atlassian.fugue.Either<Issue,Project> target, String formToken, @Nullable ApplicationUser user)
TemporaryWebAttachmentManager
TemporaryWebAttachmentManager.getTemporaryWebAttachment(java.lang.String)
.createTemporaryWebAttachment
in interface TemporaryWebAttachmentManager
stream
- attachment contentfileName
- name of attachment filecontentType
- content typesize
- size of attachmenttarget
- target for attachment - issue or project (in case if temporary attachment will be converted into
real attachment during issue creation)formToken
- token representing attachment group (usually a token for a web form)user
- the author of attachmentpublic com.atlassian.fugue.Option<TemporaryWebAttachment> getTemporaryWebAttachment(String temporaryAttachmentId)
TemporaryWebAttachmentManager
TemporaryWebAttachment.getStringId()
.getTemporaryWebAttachment
in interface TemporaryWebAttachmentManager
temporaryAttachmentId
- string attachment IDpublic Collection<TemporaryWebAttachment> getTemporaryWebAttachmentsByFormToken(String formToken)
TemporaryWebAttachmentManager
getTemporaryWebAttachmentsByFormToken
in interface TemporaryWebAttachmentManager
formToken
- temporary attachments group token used during temporary attachments creationTemporaryWebAttachment
objectspublic void updateTemporaryWebAttachment(String temporaryAttachmentId, TemporaryWebAttachment updated)
TemporaryWebAttachmentManager
updateTemporaryWebAttachment
in interface TemporaryWebAttachmentManager
temporaryAttachmentId
- string id of temporary attachment to updateupdated
- object that holds new values for the temporary attachmentpublic AttachmentsBulkOperationResult<ChangeItemBean> convertTemporaryAttachments(@Nullable ApplicationUser user, Issue issue, List<String> temporaryAttachmentsIds)
TemporaryWebAttachmentManager
TemporaryWebAttachmentManager.createTemporaryWebAttachment(java.io.InputStream, java.lang.String, java.lang.String, long, com.atlassian.fugue.Either<com.atlassian.jira.issue.Issue, com.atlassian.jira.project.Project>, java.lang.String, com.atlassian.jira.user.ApplicationUser)
into real attachments.convertTemporaryAttachments
in interface TemporaryWebAttachmentManager
user
- user which is performing conversionissue
- target issue for new attachmentstemporaryAttachmentsIds
- temporary attachments string IDs.public void clearTemporaryAttachmentsByFormToken(String formToken)
TemporaryWebAttachmentManager
clearTemporaryAttachmentsByFormToken
in interface TemporaryWebAttachmentManager
formToken
- form toke used to identify temporary attachments to removeCopyright © 2002-2016 Atlassian. All Rights Reserved.