Class CreateAttachmentParamsBean.Builder
java.lang.Object
com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean.Builder
- Enclosing class:
CreateAttachmentParamsBean
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
public static class CreateAttachmentParamsBean.Builder
extends Object
Builder for
CreateAttachmentParamsBean-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattachmentProperties(Map<String, Object> attachmentProperties) author(ApplicationUser author) build()contentType(String contentType) copySourceFile(Boolean copySourceFile) createdTime(Date createdTime) thumbnailable(Boolean thumbnailable)
-
Constructor Details
-
Builder
public Builder()Create a new builder with no parameters set. The createdTime property defaults to the current timestamp. -
Builder
public Builder(File file, String filename, @Nullable String contentType, @Nullable ApplicationUser author, Issue issue) Create a new builder with the specified parameters. The createdTime property defaults to the current timestamp.- Parameters:
file- A file on a locally accessible filesystemfilename- The desired filename for this attachment. This may be different to the filename on disk (for example with temp files used in file uploads)contentType- The desired contentType.author- The user who created this attachmentissue- The issue that this file is to be attached to
-
-
Method Details
-
file
- Parameters:
file- A file on a locally accessible filesystem- Returns:
- this
-
filename
- Parameters:
filename- The desired filename for this attachment. This may be different to the filename on disk (for example with temp files used in file uploads)- Returns:
- this
-
contentType
- Parameters:
contentType- The desired contentType.- Returns:
- this
-
author
- Parameters:
author- The user who created this attachment- Returns:
- this
-
issue
- Parameters:
issue- The issue this file will be attached to- Returns:
- this
-
zip
- Parameters:
zip- This file is a zip file. Null indicates that it is not know if this attachment is a zip file or not- Returns:
- this
-
thumbnailable
- Parameters:
thumbnailable- This file is thumbnailable (e.g. a png image). Null indicates that it is not know if this attachment is thumbnailable or not- Returns:
- this
-
attachmentProperties
public CreateAttachmentParamsBean.Builder attachmentProperties(@Nullable Map<String, Object> attachmentProperties) - Parameters:
attachmentProperties- Attachment properties (a Map of String -> Object properties). These are optional, and are used to populate a PropertySet on the Attachment (Attachment.getProperties(). Null represents an empty property set.- Returns:
- this
-
createdTime
- Parameters:
createdTime- The created time- Returns:
- this
-
copySourceFile
- Parameters:
copySourceFile- The source file should remain in file system. Null or false indicates that it should be removed.- Returns:
- this
-
build
-