AttachmentManager
, and
thumbnails via ThumbnailManager
.@Internal @Deprecated public interface AttachmentStore
Modifier and Type | Interface and Description |
---|---|
static interface |
AttachmentStore.AttachmentAdapter
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
checkValidAttachmentDirectory(Issue issue)
Deprecated.
Use
errors() instead. |
void |
checkValidTemporaryAttachmentDirectory()
Deprecated.
Use
errors() instead. |
com.atlassian.util.concurrent.Promise<Attachment> |
copy(Attachment originalAttachment,
Attachment metaData,
String newIssueKey)
Deprecated.
Copy an attachment to another issue.
|
com.atlassian.util.concurrent.Promise<Void> |
deleteAttachment(Attachment attachment)
Deprecated.
Delete the specified attachment.
|
com.atlassian.util.concurrent.Promise<Void> |
deleteAttachmentContainerForIssue(Issue issue)
Deprecated.
Delete the container for attachments for a given issue.
|
com.atlassian.fugue.Option<ErrorCollection> |
errors()
Deprecated.
Health status for this component.
|
<A> com.atlassian.util.concurrent.Promise<A> |
getAttachment(Attachment metaData,
com.atlassian.util.concurrent.Function<InputStream,A> inputStreamProcessor)
Deprecated.
Retrieve data for a given attachment.
|
File |
getAttachmentDirectory(Issue issue)
Deprecated.
Returns the physical directory of the attachments for the given issue.
|
File |
getAttachmentDirectory(Issue issue,
boolean createDirectory)
Deprecated.
Returns the physical directory of the attachments for the given issue.
|
File |
getAttachmentDirectory(String issueKey)
Deprecated.
|
File |
getAttachmentDirectory(String attachmentDirectory,
String projectKey,
String issueKey)
Deprecated.
Get the attachment directory for the given attachment base directory, project key, and issue key.
|
File |
getAttachmentFile(Attachment attachment)
Deprecated.
Returns the physical File for the given Attachment.
|
File |
getAttachmentFile(AttachmentStore.AttachmentAdapter attachment,
File attachmentDir)
Deprecated.
This is intended for cases where you want more control over where the attachment actually lives and you just want
something to handle the look up logic for the various possible filenames an attachment can have.
|
File |
getAttachmentFile(Issue issue,
Attachment attachment)
Deprecated.
Returns the physical File for the given Attachment.
|
File |
getLegacyThumbnailFile(Attachment attachment)
Deprecated.
Returns the old legacy file name for thumbnails.
|
File |
getTemporaryAttachmentDirectory()
Deprecated.
|
File |
getThumbnailDirectory(Issue issue)
Deprecated.
Returns the physical directory of the thumbnails for the given issue, creating if necessary.
|
File |
getThumbnailFile(Attachment attachment)
Deprecated.
Just like the attachments themselves, thumbnails can succumb to file system encoding problems.
|
File |
getThumbnailFile(Issue issue,
Attachment attachment)
Deprecated.
Returns the file handle for the given attachment's thumbnail.
|
com.atlassian.util.concurrent.Promise<Void> |
move(Attachment metaData,
String newIssueKey)
Deprecated.
Moves an attachment from its current issue under a new one
|
com.atlassian.util.concurrent.Promise<Attachment> |
putAttachment(Attachment metadata,
File data)
Deprecated.
Store attachment data for a given attachment.
|
com.atlassian.util.concurrent.Promise<Attachment> |
putAttachment(Attachment metadata,
InputStream data)
Deprecated.
Store attachment data for a given attachment.
|
@Nonnull File getThumbnailDirectory(@Nonnull Issue issue)
issue
- the issue whose thumbnail directory you wantFile getAttachmentDirectory(@Nonnull Issue issue, boolean createDirectory)
issue
- the issue whose attachment directory you wantcreateDirectory
- If true, and the directory does not currently exist, then the directory is created.File getTemporaryAttachmentDirectory()
File getAttachmentDirectory(@Nonnull Issue issue)
issue
- the issue whose attachment directory you wantFile getAttachmentDirectory(String attachmentDirectory, String projectKey, String issueKey)
The idea is to encapsulate all of the path-joinery magic to make future refactoring easier if we ever decide to move away from attachment-base/project-key/issue-ket
attachmentDirectory
- base of attachmentsprojectKey
- the project key the issue belongs toissueKey
- the issue key for the issueFile getAttachmentFile(Issue issue, Attachment attachment) throws DataAccessException
issue
- the issue the attachment belongs to.attachment
- the attachment.DataAccessException
- on failure getting required attachment info.File getAttachmentFile(Attachment attachment) throws DataAccessException
attachment
- the attachment.DataAccessException
- on failure getting required attachment info.File getAttachmentFile(AttachmentStore.AttachmentAdapter attachment, File attachmentDir)
In practice, this is just used during Project Import
attachment
- it's not an attachment but it acts like one for our purposes.attachmentDir
- the directory the attachments live in. This is different that the system-wide attachment
directory. i.e. this would "attachments/MKY/MKY-1" and not just "attachments"com.atlassian.util.concurrent.Promise<Attachment> putAttachment(Attachment metadata, InputStream data)
metadata
- attachment metadata, used to determine the logical key under which to store the attachment datadata
- source data. The attachment store will close this stream when it has completed.
The stream will be closed once the operation is complete.AttachmentRuntimeException
in case of error.com.atlassian.util.concurrent.Promise<Attachment> putAttachment(Attachment metadata, File data)
metadata
- attachment metadata, used to determine the logical key under which to store the attachment datadata
- source data. It is assumed that the file will exist during the attachment process (i.e. relatively
long lived).<A> com.atlassian.util.concurrent.Promise<A> getAttachment(Attachment metaData, com.atlassian.util.concurrent.Function<InputStream,A> inputStreamProcessor)
A
- The class that the inputStreamProcessor returns when run.metaData
- attachment metadata, used to determine the logical key under which to store the attachment datainputStreamProcessor
- Function that processes the attachment data.AttachmentRuntimeException
in case of error.com.atlassian.util.concurrent.Promise<Void> move(Attachment metaData, String newIssueKey)
metaData
- attachment metadata, used to determine the logical key of the attachment to be moved.newIssueKey
- the key of the new issue under which the attachment will reside.AttachmentRuntimeException
in case of error.@Nonnull File getThumbnailFile(Attachment attachment)
http://jira.atlassian.com/browse/JRA-23311
attachment
- the attachment for which to get the thumbnail filegetThumbnailFile(com.atlassian.jira.issue.Issue, Attachment)
@Nonnull File getThumbnailFile(@Nonnull Issue issue, Attachment attachment)
getThumbnailFile(Attachment)
if you already have the issue.issue
- the issue to which the attachment belongsattachment
- the attachment for which to get the thumbnail filegetThumbnailFile(Attachment)
File getLegacyThumbnailFile(Attachment attachment)
http://jira.atlassian.com/browse/JRA-23311
attachment
- the attachment in playvoid checkValidAttachmentDirectory(Issue issue) throws AttachmentException
errors()
instead.issue
- the issue whose attachment directory to check.AttachmentException
- if the directory is not writable or missing and cannot be created.void checkValidTemporaryAttachmentDirectory() throws AttachmentException
errors()
instead.AttachmentException
- if the directory is not writable or missing and cannot be created.com.atlassian.fugue.Option<ErrorCollection> errors()
com.atlassian.util.concurrent.Promise<Void> deleteAttachment(@Nonnull Attachment attachment)
com.atlassian.util.concurrent.Promise<Void> deleteAttachmentContainerForIssue(@Nonnull Issue issue)
issue
- The issue to delete attachments for.@Nonnull com.atlassian.util.concurrent.Promise<Attachment> copy(@Nonnull Attachment originalAttachment, @Nonnull Attachment metaData, @Nonnull String newIssueKey)
originalAttachment
- the original attachment.metaData
- the meta data of the copied attachment.newIssueKey
- the issue that the attachment will be copied to.Copyright © 2002-2017 Atlassian. All Rights Reserved.