public interface FileBasedAttachmentStore extends StreamAttachmentStore
TODO - We should be able to remove this once we provide sufficient methods in StreamAttachmentStore
to
eliminate access to attachments via files.
StreamAttachmentStore.Factory
Modifier and Type | Method and Description |
---|---|
io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> |
deleteAttachmentContainerForIssue(Issue issue)
Delete the container for attachments for a given issue.
|
File |
getAttachmentDirectory(String attachmentDirectory,
String projectKey,
String issueKey)
Get the attachment directory for the given attachment base directory, project key, and issue key.
|
File |
getAttachmentFile(AttachmentKey attachmentKey)
Returns the physical File for the given Attachment.
|
File |
getAttachmentFile(AttachmentStore.AttachmentAdapter attachment,
File attachmentDir)
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.
|
copyAttachment, deleteAttachment, deleteTemporaryAttachment, exists, getAttachment, getAttachmentData, getTemporaryAttachment, moveAttachment, moveTemporaryToAttachment, putAttachment, putTemporaryAttachment
errors
File getAttachmentFile(AttachmentKey attachmentKey) throws DataAccessException
attachmentKey
- the the key of the attachmentDataAccessException
- 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"io.atlassian.util.concurrent.Promise<io.atlassian.fugue.Unit> deleteAttachmentContainerForIssue(@Nonnull Issue issue)
issue
- The issue to delete attachments for.File getAttachmentDirectory(String attachmentDirectory, String projectKey, String issueKey)
The idea is to encapsulate all the path-joinery magic to make future refactoring easier if we ever decide to move away from attachment-base/project-key/issue-key
attachmentDirectory
- base of attachmentsprojectKey
- the project key the issue belongs toissueKey
- the issue key for the issueCopyright © 2002-2022 Atlassian. All Rights Reserved.