com.atlassian.jira.issue.AttachmentManager |
Known Indirect Subclasses |
Clients of @PublicApi
can expect
that programs compiled against a given version will remain binary compatible with later versions of the
@PublicApi
as per each product's API policy as long as the client does not implement/extend
@PublicApi
interfaces or classes (refer to each product's API policy for the exact
guarantee---usually binary compatibility is guaranteed at least across minor versions).
@PublicApi
interfaces and classes are not designed to be implemented or extended by clients,
we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not
affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces
annotated with @PublicSpi
are safe to extend/implement).
Manages all attachment related tasks in JIRA, which involves retrieving an attachment, creating an attachment and deleting an attachment.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | THUMBS_SUBDIR | The name of the issue-specific sub-directory in which its attachment thumbnails are stored. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determine if attachments have been enabled in JIRA and if the attachments directory exists.
| |||||||||||
Converts temporary attachment into real attachment.
| |||||||||||
This method is deprecated.
Use
convertTemporaryAttachments(com.atlassian.jira.user.ApplicationUser, Issue, java.util.List, com.atlassian.jira.web.action.issue.TemporaryAttachmentsMonitor) instead. Since v6.0.
| |||||||||||
Copy an attachment to another issue.
| |||||||||||
Copy Issue attachments to another issue.
| |||||||||||
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue, Map, Date) instead. Since v5.0.
| |||||||||||
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue, Map, Date) instead. Since v5.0.
| |||||||||||
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue, Map, Date) instead. Since v5.0.
| |||||||||||
Create an attachment both on disk, and in the database.
| |||||||||||
This method is deprecated.
Use
createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean) instead. Since v6.0.
| |||||||||||
This method is deprecated.
Use
createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean) instead. Since v6.0.
| |||||||||||
This method is deprecated.
Use
createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean) instead. Since v6.0.
| |||||||||||
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue) instead. Since v5.0.
| |||||||||||
This method is deprecated.
Use
createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean) instead. Since v6.0.
| |||||||||||
Creates new temporary attachment which may be later converted into real attachment.
| |||||||||||
Delete an attachment from the database and from the attachment store.
| |||||||||||
This method is deprecated.
This will no longer be exposed by AttachmentManager.
| |||||||||||
Removes temporary attachment with given id
| |||||||||||
Get a single attachment by its ID.
| |||||||||||
Get a list of all attachments for a certain issue, sorted according to the specified comparator.
| |||||||||||
Get a list of all attachments for a certain issue.
| |||||||||||
Determine if screenshot applet has been enabled in JIRA.
| |||||||||||
Determine if the screenshot applet is supported by the user's operating system.
| |||||||||||
Move Issue attachments to a new directory.
| |||||||||||
Stores the thumbnailble flag for this attachment
| |||||||||||
Stores the zip flag for this attachment
| |||||||||||
Get binary content of the attachment
| |||||||||||
This method is deprecated.
Use
convertTemporaryAttachments(ApplicationUser, Issue, List instead. Since v6.4.
| |||||||||||
Create an attachment.
|
The name of the issue-specific sub-directory in which its attachment thumbnails are stored.
Determine if attachments have been enabled in JIRA and if the attachments directory exists.
Converts temporary attachment into real attachment.
params | Parameters describing |
---|
ChangeItemBean
with all the changes to the issue.
This method is deprecated.
Use convertTemporaryAttachments(com.atlassian.jira.user.ApplicationUser, Issue, java.util.List, com.atlassian.jira.web.action.issue.TemporaryAttachmentsMonitor)
instead. Since v6.0.
Converts a set of provided temporary attachments to real attachments attached to an issue. This method will also clean up any temporary attachments still linked to the issue via the TemporaryAttachmentsMonitor.
user | The user performing the action |
---|---|
issue | The issue attachments should be linked to |
selectedAttachments | The temporary attachment ids to convert as selected by the user |
temporaryAttachmentsMonitor | TemporaryAttachmentsMonitor containing information about all temporary attachments |
AttachmentException | If there were problems with the Attachment itself |
---|
Copy an attachment to another issue.
attachment | the attachment to copy to a new issue |
---|---|
author | the user that will own the new attachment |
newIssueKey | the key of the issue that the attachment will be copied to |
Copy Issue attachments to another issue.
issue | the issue attachments will be copied from |
---|---|
author | the user that will own the new attachments |
newIssueKey | the key of the issue that the attachment will be copied to |
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue, Map, Date) instead. Since v5.0.
Create an attachment in the database. Note that this does not create it on disk, nor does it create a change item.
issue | the issue that this attachment is attached to |
---|---|
author | The user who created this attachment |
mimetype | mimetype |
filename | The desired filename for this attachment. |
filesize | filesize |
attachmentProperties | Attachment properties (a Map of String -> Object properties). |
createdTime | when the attachment was created |
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue, Map, Date) instead. Since v5.0.
Create an attachment both on disk, and in the database.
file | A file on a locally accessible filesystem |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
author | The user who created this attachment |
issue | The issue that this attachment is attached to |
attachmentProperties | Attachment properties (a Map of String -> Object properties). These are optional,
and are used to populate a PropertySet on the Attachment (getProperties() . Pass null to set no properties |
createdTime | the created time |
ChangeItemBean
with all the changes to the issue.AttachmentException | if an error occurs while attempting to copy the file |
---|
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue, Map, Date) instead. Since v5.0.
Create an attachment both on disk, and in the database.
file | A file on a locally accessible filesystem |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
author | The user who created this attachment |
issue | The issue that this attachment is attached to |
zip | This file is a zip file. Null indicates that it is not know if this attachment is a zip file or not |
thumbnailable | This file is thumbnailable (e.g. a png image). Null indicates that it is not know if this attachment is thumbnailable or not |
attachmentProperties | Attachment properties (a Map of String -> Object properties). These are optional,
and are used to populate a PropertySet on the Attachment (getProperties() . Pass null to set no properties |
createdTime | the created time |
ChangeItemBean
with all the changes to the issue.AttachmentException | if an error occurs while attempting to copy the file |
---|
Create an attachment both on disk, and in the database.
createAttachmentParamsBean | Parameters which describe created attachment |
---|
ChangeItemBean
with all the changes to the issue.AttachmentException | if an IO error occurs while attempting to copy the file |
---|
This method is deprecated.
Use createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean)
instead. Since v6.0.
Create an attachment both on disk, and in the database.
file | A file on a locally accessible filesystem |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
author | The user who created this attachment |
issue | The issue that this file is to be attached to |
attachmentProperties | Attachment properties (a Map of String -> Object properties). These are optional,
and are used to populate a PropertySet on the Attachment (getProperties() . Pass null to set no properties |
createdTime | the created time |
ChangeItemBean
with all the changes to the issue.AttachmentException | if an IO error occurs while attempting to copy the file |
---|
This method is deprecated.
Use createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean)
instead. Since v6.0.
Create an attachment both on disk, and in the database.
file | A file on a locally accessible filesystem |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
author | The user who created this attachment |
issue | The issue that this file is to be attached to |
zip | This file is a zip file. Null indicates that it is not know if this attachment is a zip file or not |
thumbnailable | This file is thumbnailable (e.g. a png image). Null indicates that it is not know if this attachment is thumbnailable or not |
attachmentProperties | Attachment properties (a Map of String -> Object properties). These are optional,
and are used to populate a PropertySet on the Attachment (getProperties() . Pass null to set no properties |
createdTime | the created time |
ChangeItemBean
with all the changes to the issue.AttachmentException | if an IO error occurs while attempting to copy the file |
---|
This method is deprecated.
Use createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean)
instead. Since v6.0.
Same as the #createAttachment(File, String, String, User, Issue, Map, Date) method, except it submits no attachmentProperties and uses now() for the created time.
file | A file on a locally accessible filesystem |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
author | The user who created this attachment |
issue | The issue that this attachment is attached to |
ChangeItemBean
with all the changes to the issue.AttachmentException | if an IO error occurs while attempting to copy the file |
---|
This method is deprecated.
Use #createAttachment(File, String, String, User, Issue) instead. Since v5.0.
Same as the #createAttachment(java.io.File, String, String, User, org.ofbiz.core.entity.GenericValue, java.util.Map, java.util.Date) method, except it submits no attachmentProperties and uses now() for the created time.
file | A file on a locally accessible filesystem |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
author | The user who created this attachment |
issue | The issue that this attachment is attached to |
ChangeItemBean
with all the changes to the issue.AttachmentException | if an error occurs while attempting to copy the file |
---|
This method is deprecated.
Use createAttachment(com.atlassian.jira.issue.attachment.CreateAttachmentParamsBean)
instead. Since v6.0.
Create an attachment both on disk, and in the database by copying the provided file instead of moving it.
file | A file on a locally accessible filesystem, this will be copied, not moved. |
---|---|
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) |
contentType | The desired contentType. Implementations of this interface can choose to override this value as appropriate |
attachmentAuthor | The username of the user who created this attachment, this is not validated so it must be a valid username |
issue | The id of the issue that this attachment is attached to |
attachmentProperties | Attachment properties (a Map of String -> Object properties). These are optional,
and are used to populate a PropertySet on the Attachment (getProperties() . Pass null to set no properties |
createdTime | when the attachment was created |
AttachmentException | if any errors occur. |
---|
Creates new temporary attachment which may be later converted into real attachment.
stream | Stream with temporary attachment content |
---|---|
size | Size of temporary attachment |
Delete an attachment from the database and from the attachment store.
attachment | the Attachment |
---|
RemoveException | if the attachment cannot be removed from the attachment store |
---|
@Internal
classes and interfaces can not expect to be compatible with any version
other than the version they were compiled against (even minor version and milestone releases may break binary
compatibility with respect to @Internal
elements).
This method is deprecated.
This will no longer be exposed by AttachmentManager.
Delete the attachment directory from disk if the directory is empty.
issue | the issue whose attachment directory we wish to delete. |
---|
RemoveException | if the directory can not be removed or is not empty. |
---|
Removes temporary attachment with given id
temporaryAttachmentId | id of temporary attachment |
---|
Get a single attachment by its ID.
id | the Attachment ID |
---|
DataAccessException | if there is a problem accessing the database. |
---|---|
AttachmentNotFoundException | thrown if an attachment with the passed id does not exist. |
Get a list of all attachments for a certain issue, sorted according to the specified comparator.
issue | the Issue |
---|---|
comparator | used for sorting |
Attachment
objectsDataAccessException | if there is a problem accessing the database. |
---|
Get a list of all attachments for a certain issue.
issue | the Issue |
---|
Attachment
objectsDataAccessException | if there is a problem accessing the database. |
---|
Determine if screenshot applet has been enabled in JIRA.
Determine if the screenshot applet is supported by the user's operating system.
Note. This always returns true now as we support screenshots on all our supported platforms
Move Issue attachments to a new directory. This method is intended for Move/Bulk Move only.
oldIssue | the issue attachments will be moved from |
---|---|
newIssueKey | the new issue key |
Stores the thumbnailble flag for this attachment
attachment | The attachment |
---|---|
thumbnailable | True if this attachment is thumnailable |
Stores the zip flag for this attachment
attachment | The attachment |
---|---|
zip | True if this attachment is a zip file |
Get binary content of the attachment
attachment | the attachment whose content to stream (required) |
---|---|
consumer | the consumer of the stream (required) |
NoAttachmentDataException | if the attachment's contents cannot be found. |
---|---|
AttachmentReadException | if a problem occurs when the consumer processes the attachment's contents. |
IOException | here for compatibility, but won't actually be thrown |
This method is deprecated.
Use convertTemporaryAttachments(ApplicationUser, Issue, List
instead. Since v6.4.
Converts a set of provided temporary attachments to real attachments attached to an issue. This method will also clean up any temporary attachments still linked to the issue via the TemporaryAttachmentsMonitor.
user | The user performing the action |
---|---|
issue | The issue attachments should be linked to |
selectedAttachments | The temporary attachment ids to convert as selected by the user |
temporaryAttachmentsMonitor | TemporaryAttachmentsMonitor containing information about all temporary attachments |
Create an attachment.
params | Parameters which describe created attachment |
---|
ChangeItemBean
with all the changes to the issue or the AttachmentError in case of any
errors while attempting to create attachment.