@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) |
public DefaultTemporaryWebAttachmentManager(AttachmentManager attachmentManager, AttachmentValidator attachmentValidator, I18nHelper.BeanFactory beanFactory, TemporaryWebAttachmentsMonitorLocator temporaryWebAttachmentsMonitorLocator, ApplicationProperties applicationProperties, TemporaryWebAttachmentFactory temporaryWebAttachmentsFactory)
@ParametersAreNonnullByDefault public io.atlassian.fugue.Either<AttachmentError,TemporaryWebAttachment> createTemporaryWebAttachment(InputStream stream, String fileName, String contentType, long size, io.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 io.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, io.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-2019 Atlassian. All Rights Reserved.