@ParametersAreNonnullByDefault public interface StreamAttachmentStore extends AttachmentHealth
com.atlassian.jira.issue.attachment.AttachmentStore
and is dedicated to replace it.Modifier and Type | Method and Description |
---|---|
io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> |
copyAttachment(AttachmentKey sourceAttachmentKey,
AttachmentKey newAttachmentKey)
Copies the attachment identified by
oldAttachmentKey to be identified also by newAttachmentKey . |
io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> |
deleteAttachment(AttachmentKey attachmentKey)
Deletes the specified attachment.
|
io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> |
deleteAttachmentContainerForIssue(Issue issue)
Delete the container for attachments for a given issue if it exists.
|
io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> |
deleteTemporaryAttachment(TemporaryAttachmentId temporaryAttachmentId)
Deletes temporary attachment created previously by
putTemporaryAttachment(java.io.InputStream, long) . |
io.atlassian.util.concurrent.Promise<Boolean> |
exists(AttachmentKey attachmentKey)
Indicates whether the specified attachment exists.
|
<A> io.atlassian.util.concurrent.Promise<A> |
getAttachment(AttachmentKey attachmentKey,
java.util.function.Function<InputStream,A> inputStreamProcessor)
Retrieves the specified attachment.
|
<A> io.atlassian.util.concurrent.Promise<A> |
getAttachmentData(AttachmentKey attachmentKey,
java.util.function.Function<AttachmentGetData,A> attachmentGetDataProcessor)
Retrieves the specified attachment.
|
com.atlassian.dc.filestore.api.FileStore.Path |
getAttachmentPath(Attachment attachment)
Returns the file for the given attachment.
|
com.atlassian.dc.filestore.api.FileStore.Path |
getAttachmentPath(AttachmentKey attachmentKey)
Returns the physical File for the given Attachment.
|
com.atlassian.dc.filestore.api.FileStore.Path |
getAttachmentPath(com.atlassian.dc.filestore.api.FileStore.Path rootAttachmentPath,
String projectKey,
String issueKey)
Get the attachment path for the given attachment base directory, project key, and issue key.
|
Optional<com.atlassian.dc.filestore.api.FileStore.Path> |
getAttachmentPathForIssue(Issue issue)
Returns the path of the attachments for the given issue.
|
<A> io.atlassian.util.concurrent.Promise<A> |
getTemporaryAttachment(TemporaryAttachmentId temporaryAttachmentId,
java.util.function.Function<InputStream,A> inputStreamProcessor)
Retrieve data for temporary attachment.
|
io.atlassian.util.concurrent.Promise<Void> |
move(Attachment attachment,
String newIssueKey)
Moves an attachment from its current issue to the one with the given key.
|
io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> |
moveTemporaryToAttachment(TemporaryAttachmentId temporaryAttachmentId,
AttachmentKey destinationKey)
Moving temporary attachment created by
putTemporaryAttachment(java.io.InputStream, long) to real attachment. |
io.atlassian.util.concurrent.Promise<StoreAttachmentResult> |
putAttachment(StoreAttachmentBean storeAttachmentBean)
Stores the given attachment.
|
io.atlassian.util.concurrent.Promise<TemporaryAttachmentId> |
putTemporaryAttachment(InputStream inputStream,
long size)
Creates temporaryAttachment in store which can be later moved to attachment via
moveTemporaryToAttachment(TemporaryAttachmentId, AttachmentKey) |
errors
io.atlassian.util.concurrent.Promise<StoreAttachmentResult> putAttachment(StoreAttachmentBean storeAttachmentBean)
storeAttachmentBean
- attachment metadata, used to determine the logical key under which to store the
attachment dataAttachmentRuntimeException
in case of error.<A> io.atlassian.util.concurrent.Promise<A> getAttachment(AttachmentKey attachmentKey, java.util.function.Function<InputStream,A> inputStreamProcessor)
A
- The class that the inputStreamProcessor returns when run.attachmentKey
- The key of attachment used to identify attachment datainputStreamProcessor
- Function that processes the attachment data.AttachmentRuntimeException
in case of error.<A> io.atlassian.util.concurrent.Promise<A> getAttachmentData(AttachmentKey attachmentKey, java.util.function.Function<AttachmentGetData,A> attachmentGetDataProcessor)
getAttachment(AttachmentKey, Function)
.A
- The class that the attachmentGetDataProcessor returns when run.attachmentKey
- The key of attachment used to identify attachment dataattachmentGetDataProcessor
- Function that processes the attachment data.AttachmentRuntimeException
in case of error.io.atlassian.util.concurrent.Promise<Void> move(Attachment attachment, String newIssueKey)
attachment
- provides the logical key of the attachment to be movednewIssueKey
- the key of the new issue under which the attachment will resideAttachmentRuntimeException
in case of error.io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> copyAttachment(AttachmentKey sourceAttachmentKey, AttachmentKey newAttachmentKey)
oldAttachmentKey
to be identified also by newAttachmentKey
.sourceAttachmentKey
- attachmentKey of existing attachment which should be copiednewAttachmentKey
- attachmentKey under which copiedio.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> deleteAttachment(AttachmentKey attachmentKey)
attachmentKey
- the attachment keyio.atlassian.util.concurrent.Promise<TemporaryAttachmentId> putTemporaryAttachment(InputStream inputStream, long size)
moveTemporaryToAttachment(TemporaryAttachmentId, AttachmentKey)
inputStream
- stream to temporary attachment datasize
- the size of provided streamio.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> moveTemporaryToAttachment(TemporaryAttachmentId temporaryAttachmentId, AttachmentKey destinationKey)
putTemporaryAttachment(java.io.InputStream, long)
to real attachment.temporaryAttachmentId
- id of temporary attachment, returned by putTemporaryAttachment(java.io.InputStream, long)
destinationKey
- destination key of under which attachment will be identifiedio.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> deleteTemporaryAttachment(TemporaryAttachmentId temporaryAttachmentId)
putTemporaryAttachment(java.io.InputStream, long)
.temporaryAttachmentId
- id of temporary attachment<A> io.atlassian.util.concurrent.Promise<A> getTemporaryAttachment(TemporaryAttachmentId temporaryAttachmentId, java.util.function.Function<InputStream,A> inputStreamProcessor)
A
- The class that the inputStreamProcessor returns when run.temporaryAttachmentId
- The id of temporary attachmentinputStreamProcessor
- Function that processes the attachment data.AttachmentRuntimeException
in case of error.io.atlassian.util.concurrent.Promise<Boolean> exists(AttachmentKey attachmentKey)
attachmentKey
- key of attachment to check for existencePromise
to boolean result, true if attachment exists and false
otherwiseio.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> deleteAttachmentContainerForIssue(Issue issue)
issue
- The issue to delete attachments for.Optional<com.atlassian.dc.filestore.api.FileStore.Path> getAttachmentPathForIssue(Issue issue)
issue
- the issue whose attachment directory you wantcom.atlassian.dc.filestore.api.FileStore.Path getAttachmentPath(com.atlassian.dc.filestore.api.FileStore.Path rootAttachmentPath, String projectKey, String issueKey)
rootAttachmentPath
- base of attachmentsprojectKey
- the project key the issue belongs toissueKey
- the issue key for the issuecom.atlassian.dc.filestore.api.FileStore.Path getAttachmentPath(Attachment attachment)
attachment
- the attachment for which to retrieve the file.AttachmentsDisabledException
- in case attachments have been disabled by the administrator.com.atlassian.dc.filestore.api.FileStore.Path getAttachmentPath(AttachmentKey attachmentKey) throws AttachmentsDisabledException
attachmentKey
- the key of the attachmentAttachmentsDisabledException
- in case attachments have been disabled by the administrator.Copyright © 2002-2023 Atlassian. All Rights Reserved.