Package com.atlassian.jira.web.util
Interface WebAttachmentManager
- All Known Implementing Classes:
DefaultWebAttachmentManager
Deprecated.
Manager for issue attachments.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateAttachment
(webwork.multipart.MultiPartRequestWrapper requestWrapper, ApplicationUser remoteUser, Issue issue, String fileParamName, Map<String, Object> attachmentProperties) createAttachment
(webwork.multipart.MultiPartRequestWrapper requestWrapper, ApplicationUser remoteUser, org.ofbiz.core.entity.GenericValue issue, String fileParamName, Map<String, Object> attachmentProperties) Deprecated.Use#createAttachment(webwork.multipart.MultiPartRequestWrapper, com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue, String, java.util.Map)
instead.createTemporaryAttachment
(InputStream stream, String fileName, String contentType, long size, Issue issue, Project project) createTemporaryAttachment
(InputStream stream, String fileName, String contentType, long size, Issue issue, Project project, String formToken) createTemporaryAttachment
(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, Issue issue, Project project) createTemporaryAttachment
(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, Issue issue, Project project, String formToken) boolean
validateAttachmentIfExists
(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, boolean required) Deprecated.This method doesn't have replacement as it is not needed anymore in the new API.
-
Method Details
-
createAttachment
@Deprecated ChangeItemBean createAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, ApplicationUser remoteUser, Issue issue, String fileParamName, Map<String, Object> attachmentProperties) throws AttachmentExceptionDeprecated.Create an issue's attachment.- Parameters:
requestWrapper
- eg. obtained fromServletActionContext.getMultiPartRequest()
remoteUser
- eg. fromJiraWebActionSupport.getLoggedInUser()
issue
- Issue to associate attachment withfileParamName
- Name of form parameter specifying filename (in requestWrapper).attachmentProperties
- Arbitrary key:value properties to store with this attachment. Key is a String, value is an Object mappable to aPropertySet
. Eg. {"attachment.copyright.licensed" -> Boolean.TRUE}- Throws:
AttachmentException
-
createAttachment
@Deprecated ChangeItemBean createAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, ApplicationUser remoteUser, org.ofbiz.core.entity.GenericValue issue, String fileParamName, Map<String, Object> attachmentProperties) throws AttachmentException, org.ofbiz.core.entity.GenericEntityExceptionDeprecated.Use#createAttachment(webwork.multipart.MultiPartRequestWrapper, com.atlassian.crowd.embedded.api.User, com.atlassian.jira.issue.Issue, String, java.util.Map)
instead. Since v5.0.Create an issue's attachment.- Parameters:
requestWrapper
- eg. obtained fromServletActionContext.getMultiPartRequest()
remoteUser
- eg. fromJiraWebActionSupport.getLoggedInUser()
issue
- Issue to associate attachment withfileParamName
- Name of form parameter specifying filename (in requestWrapper).attachmentProperties
- Arbitrary key:value properties to store with this attachment. Key is a String, value is an Object mappable to aPropertySet
. Eg. {"attachment.copyright.licensed" -> Boolean.TRUE}- Throws:
AttachmentException
org.ofbiz.core.entity.GenericEntityException
-
createTemporaryAttachment
@Deprecated TemporaryAttachment createTemporaryAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, Issue issue, Project project, String formToken) throws AttachmentException Deprecated.Creates a temporary attachment on disk. These attachment generally only live for the duration of a user's session and will also be deleted on exit of the JVM. This method will not create a link to the issue yet, but simply copy the attachment to a temp directory in the attachments folder and store all the relevant details in the returnedTemporaryAttachment
object- Parameters:
requestWrapper
- the wrapper containing getFile() and getFilesystemName() describing the attachmentfileParamName
- ame of form parameter specifying filename (in requestWrapper).issue
- The issue that this temporary attachment is for. Can be null when creating a new issueproject
- The project where the attachment is to be placed. This is used to do security checks when creating an issue and there is no issue to run a check on. Will be ignored when issue is not null.formToken
-- Returns:
- A
TemporaryAttachment
containing details about where the temp attachment was created - Throws:
AttachmentException
- if there was an error saving the temporary attachment.
-
createTemporaryAttachment
@Deprecated TemporaryAttachment createTemporaryAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, Issue issue, Project project) throws AttachmentException Creates a temporary attachment on disk. These attachment generally only live for the duration of a user's session and will also be deleted on exit of the JVM. This method will not create a link to the issue yet, but simply copy the attachment to a temp directory in the attachments folder and store all the relevant details in the returnedTemporaryAttachment
object- Parameters:
requestWrapper
- the wrapper containing getFile() and getFilesystemName() describing the attachmentfileParamName
- ame of form parameter specifying filename (in requestWrapper).issue
- The issue that this temporary attachment is for. Can be null when creating a new issueproject
- The project where the attachment is to be placed. This is used to do security checks when creating an issue and there is no issue to run a check on. Will be ignored when issue is not null.- Returns:
- A
TemporaryAttachment
containing details about where the temp attachment was created - Throws:
AttachmentException
- if there was an error saving the temporary attachment.
-
createTemporaryAttachment
@Deprecated TemporaryAttachment createTemporaryAttachment(InputStream stream, String fileName, String contentType, long size, Issue issue, Project project, String formToken) throws AttachmentException Deprecated.Creates a temporary attachment on disk. These attachment generally only live for the duration of a user's session and will also be deleted on exit of the JVM. This method will not create a link to the issue yet, but simply copy the attachment to a temp directory in the attachments folder and store all the relevant details in the returnedTemporaryAttachment
object- Parameters:
stream
- the input stream for the attachment.fileName
- the name of the attachment.contentType
- the content type of the passed stream.size
- the size of the passed stream.issue
- The issue that this temporary attachment is for. Can be null when creating a new issue.project
- The project where the attachment is to be placed. This is used to do security checks when creating an issue and there is no issue to run a check on. Will be ignored when issue is not null.formToken
-- Returns:
- A
TemporaryAttachment
containing details about where the temp attachment was created - Throws:
AttachmentException
- if there was an error saving the temporary attachment.
-
createTemporaryAttachment
@Deprecated TemporaryAttachment createTemporaryAttachment(InputStream stream, String fileName, String contentType, long size, Issue issue, Project project) throws AttachmentException Deprecated.Creates a temporary attachment on disk. These attachment generally only live for the duration of a user's session and will also be deleted on exit of the JVM. This method will not create a link to the issue yet, but simply copy the attachment to a temp directory in the attachments folder and store all the relevant details in the returnedTemporaryAttachment
object- Parameters:
stream
- the input stream for the attachment.fileName
- the name of the attachment.contentType
- the content type of the passed stream.size
- the size of the passed stream.issue
- The issue that this temporary attachment is for. Can be null when creating a new issue.project
- The project where the attachment is to be placed. This is used to do security checks when creating an issue and there is no issue to run a check on. Will be ignored when issue is not null.- Returns:
- A
TemporaryAttachment
containing details about where the temp attachment was created - Throws:
AttachmentException
- if there was an error saving the temporary attachment.
-
validateAttachmentIfExists
@Deprecated boolean validateAttachmentIfExists(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, boolean required) throws AttachmentException Deprecated.This method doesn't have replacement as it is not needed anymore in the new API. Seeinstead
. Since v6.4.Determine whether an attachment exists and is valid (i.e. non-zero and contains no invalid characters)- Parameters:
requestWrapper
- the wrapper containing getFile() and getFilesystemName() describing the attachmentfileParamName
- the parameter in the wrapper to use to find attachment inforequired
- whether having an valid and existent attachment is mandatory- Returns:
- whether the attachment is valid and exists
- Throws:
AttachmentException
- if the attachment is zero-length, contains invalid characters, or simply doesn't exist when required
-
TemporaryWebAttachmentManager
instead. Since v6.4.