AttachmentManager
, and
thumbnails via ThumbnailManager
. To be deleted in Jira 10.0.0.@Internal @Deprecated public interface AttachmentStore
Modifier and Type | Interface and Description |
---|---|
static interface |
AttachmentStore.AttachmentAdapter
Deprecated.
A lightweight value object that provides the ID and filename of an attachment.
|
Modifier and Type | Method and Description |
---|---|
void |
checkValidAttachmentDirectory(Issue issue)
Deprecated.
Checks that the Attachment directory of the given issue is right to go - writable, accessible etc.
|
void |
checkValidTemporaryAttachmentDirectory()
Deprecated.
Checks that the temporary directory for attachment uploads is right to go - writable, accessible etc.
|
File |
getAttachmentDirectory(Issue issue,
boolean createDirectory)
Deprecated.
Returns the physical directory of the attachments for the given issue.
|
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(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 lookup 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.
To be deleted in Jira 10.0.0. use
AttachmentConfigManager.getTemporaryAttachmentDirectory() instead |
File |
getThumbnailDirectory(Issue issue)
Deprecated.
Returns the physical directory of the thumbnails for the given issue, creating it 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.
|
@Nonnull File getTemporaryAttachmentDirectory()
AttachmentConfigManager.getTemporaryAttachmentDirectory()
insteadFile getAttachmentFile(Issue issue, Attachment attachment) throws DataAccessException
issue
- the issue to which the attachment belongsattachment
- the attachmentDataAccessException
- on failure getting required attachment info.@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 exist, this method creates itFile getAttachmentDirectory(String attachmentDirectory, String projectKey, String issueKey)
The idea is to encapsulate all the path-joinery logic 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 issueFile getAttachmentFile(AttachmentStore.AttachmentAdapter attachment, File attachmentDir)
attachment
- it's not an attachment, but it acts like one for our purposes.attachmentDir
- the directory in which the attachments live. This is different to the system-wide attachment
directory, for example "attachments/MKY/MKY-1" rather than simply "attachments"@Nonnull File getThumbnailFile(Attachment attachment)
See JRASERVER-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)
See JRASERVER-23311.
attachment
- the attachment in playvoid checkValidAttachmentDirectory(Issue issue) throws AttachmentException
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
AttachmentException
- if the directory is not writable or missing and cannot be created.Copyright © 2002-2023 Atlassian. All Rights Reserved.