public interface SimpleAttachmentStore extends AttachmentHealth
This may eventually replace AttachmentStore.
Modifier and Type | Interface and Description |
---|---|
static interface |
SimpleAttachmentStore.Factory
Factory for external plugins to retrieve a new store
|
Modifier and Type | Method and Description |
---|---|
com.atlassian.util.concurrent.Promise<Attachment> |
copy(Attachment originalAttachment,
Attachment metaData,
String newIssueKey) |
com.atlassian.util.concurrent.Promise<io.atlassian.blobstore.client.api.Unit> |
delete(Attachment attachment)
Delete the specified attachment.
|
com.atlassian.util.concurrent.Promise<Boolean> |
exists(Attachment metaData)
Returns true if the attachment exists in the store.
|
<A> com.atlassian.util.concurrent.Promise<A> |
get(Attachment metaData,
com.google.common.base.Function<InputStream,A> inputStreamProcessor)
Retrieve data for a given attachment.
|
com.atlassian.util.concurrent.Promise<io.atlassian.blobstore.client.api.Unit> |
move(Attachment metaData,
String newIssueKey)
Moves an attachment from its current issue under a new one
|
com.atlassian.util.concurrent.Promise<Attachment> |
put(Attachment metaData,
File data)
Store attachment data for a given attachment.
|
com.atlassian.util.concurrent.Promise<Attachment> |
put(Attachment metaData,
InputStream data)
Store attachment data for a given attachment.
|
errors
@Nonnull com.atlassian.util.concurrent.Promise<Attachment> put(@Nonnull Attachment metaData, @Nonnull 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.@Nonnull com.atlassian.util.concurrent.Promise<Attachment> put(@Nonnull Attachment metaData, @Nonnull 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).@Nonnull <A> com.atlassian.util.concurrent.Promise<A> get(Attachment metaData, com.google.common.base.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. This function MUST clean up upon failure of reading from
the input stream, and must support being re-executed. e.g. If the function writes out to a temp file, the temp file should be
created by the function.AttachmentRuntimeException
in case of error.@Nonnull com.atlassian.util.concurrent.Promise<Boolean> exists(Attachment metaData)
metaData
- attachment metadata, used to determine the logical key under which to store the attachment dataAttachmentRuntimeException
in case of error.@Nonnull com.atlassian.util.concurrent.Promise<io.atlassian.blobstore.client.api.Unit> delete(Attachment attachment)
attachment
- The attachment to delete.@Nonnull com.atlassian.util.concurrent.Promise<io.atlassian.blobstore.client.api.Unit> 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 com.atlassian.util.concurrent.Promise<Attachment> copy(@Nonnull Attachment originalAttachment, @Nonnull Attachment metaData, @Nonnull String newIssueKey)
Copyright © 2002-2015 Atlassian. All Rights Reserved.