public class DefaultWebAttachmentManager extends Object implements WebAttachmentManager
| Constructor and Description |
|---|
DefaultWebAttachmentManager(AttachmentManager attachmentManager,
I18nHelper.BeanFactory beanFactory,
JiraAuthenticationContext authenticationContext,
TemporaryAttachmentsMonitorLocator locator,
AttachmentService attachmentService,
ApplicationProperties applicationProperties) |
| Modifier and Type | Method and Description |
|---|---|
ChangeItemBean |
createAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper,
ApplicationUser remoteUser,
org.ofbiz.core.entity.GenericValue issue,
String fileParamName,
Map<String,Object> attachmentProperties)
Create an issue's attachment.
|
ChangeItemBean |
createAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper,
ApplicationUser remoteUser,
Issue issue,
String fileParamName,
Map<String,Object> attachmentProperties)
Create an issue's attachment.
|
TemporaryAttachment |
createTemporaryAttachment(InputStream stream,
String fileName,
String contentType,
long size,
Issue issue,
Project project)
Creates a temporary attachment on disk.
|
TemporaryAttachment |
createTemporaryAttachment(InputStream stream,
String fileName,
String contentType,
long size,
Issue issue,
Project project,
String formToken)
Creates a temporary attachment on disk.
|
TemporaryAttachment |
createTemporaryAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper,
String fileParamName,
Issue issue,
Project project)
Creates a temporary attachment on disk.
|
TemporaryAttachment |
createTemporaryAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper,
String fileParamName,
Issue issue,
Project project,
String formToken)
Creates a temporary attachment on disk.
|
boolean |
validateAttachmentIfExists(webwork.multipart.MultiPartRequestWrapper requestWrapper,
String fileParamName,
boolean required)
Determine whether an attachment exists and is valid (i.e.
|
public DefaultWebAttachmentManager(AttachmentManager attachmentManager, I18nHelper.BeanFactory beanFactory, JiraAuthenticationContext authenticationContext, TemporaryAttachmentsMonitorLocator locator, AttachmentService attachmentService, ApplicationProperties applicationProperties)
public ChangeItemBean createAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, ApplicationUser remoteUser, Issue issue, String fileParamName, Map<String,Object> attachmentProperties) throws AttachmentException
WebAttachmentManagercreateAttachment in interface WebAttachmentManagerrequestWrapper - eg. obtained from ServletActionContext.getMultiPartRequest()remoteUser - eg. from JiraWebActionSupport.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 a PropertySet.
Eg. {"attachment.copyright.licensed" -> Boolean.TRUE}AttachmentExceptionpublic ChangeItemBean createAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, ApplicationUser remoteUser, org.ofbiz.core.entity.GenericValue issue, String fileParamName, Map<String,Object> attachmentProperties) throws AttachmentException
WebAttachmentManagercreateAttachment in interface WebAttachmentManagerrequestWrapper - eg. obtained from ServletActionContext.getMultiPartRequest()remoteUser - eg. from JiraWebActionSupport.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 a PropertySet.
Eg. {"attachment.copyright.licensed" -> Boolean.TRUE}AttachmentExceptionpublic TemporaryAttachment createTemporaryAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, Issue issue, Project project, String formToken) throws AttachmentException
WebAttachmentManagerTemporaryAttachment objectcreateTemporaryAttachment in interface WebAttachmentManagerrequestWrapper - 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.TemporaryAttachment containing details about where the temp attachment was createdAttachmentException - if there was an error saving the temporary attachment.public TemporaryAttachment createTemporaryAttachment(webwork.multipart.MultiPartRequestWrapper requestWrapper, String fileParamName, Issue issue, Project project) throws AttachmentException
WebAttachmentManagerTemporaryAttachment objectcreateTemporaryAttachment in interface WebAttachmentManagerrequestWrapper - 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.TemporaryAttachment containing details about where the temp attachment was createdAttachmentException - if there was an error saving the temporary attachment.public TemporaryAttachment createTemporaryAttachment(InputStream stream, String fileName, String contentType, long size, Issue issue, Project project, String formToken) throws AttachmentException
WebAttachmentManagerTemporaryAttachment objectcreateTemporaryAttachment in interface WebAttachmentManagerstream - 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.TemporaryAttachment containing details about where the temp attachment was createdAttachmentException - if there was an error saving the temporary attachment.public TemporaryAttachment createTemporaryAttachment(InputStream stream, String fileName, String contentType, long size, Issue issue, Project project) throws AttachmentException
WebAttachmentManagerTemporaryAttachment objectcreateTemporaryAttachment in interface WebAttachmentManagerstream - 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.TemporaryAttachment containing details about where the temp attachment was createdAttachmentException - if there was an error saving the temporary attachment.public boolean validateAttachmentIfExists(webwork.multipart.MultiPartRequestWrapper requestWrapper,
String fileParamName,
boolean required)
throws AttachmentException
WebAttachmentManagervalidateAttachmentIfExists in interface WebAttachmentManagerrequestWrapper - 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 mandatoryAttachmentException - if the attachment is zero-length, contains invalid characters, or simply doesn't exist
when requiredCopyright © 2002-2019 Atlassian. All Rights Reserved.