|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
AttachmentManager
, and
thumbnails via ThumbnailManager
.
@Internal public interface AttachmentStore
Nested Class Summary | |
---|---|
static interface |
AttachmentStore.AttachmentAdapter
Deprecated. |
Method Summary | ||
---|---|---|
void |
checkValidAttachmentDirectory(Issue issue)
Deprecated. Use errors() instead. |
|
void |
checkValidTemporaryAttachmentDirectory()
Deprecated. Use errors() instead. |
|
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. |
|
|
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. |
Method Detail |
---|
@Nonnull File getThumbnailDirectory(@Nonnull Issue issue)
issue
- the issue whose thumbnail directory you want
@Nullable File getAttachmentDirectory(@Nonnull String issueKey)
File 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 want
File getAttachmentDirectory(String attachmentDirectory, String projectKey, String issueKey)
attachmentDirectory
- base of attachmentsprojectKey
- the project key the issue belongs toissueKey
- the issue key for the issue
File 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)
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)
attachment
- the attachment for which to get the thumbnail file
getThumbnailFile(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 file
getThumbnailFile(Attachment)
File getLegacyThumbnailFile(Attachment attachment)
attachment
- the attachment in play
void 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |