java.lang.Object | |
↳ | com.atlassian.jira.util.AttachmentUtils |
This class is deprecated.
Use AttachmentManager
only. Since v6.1
Static utilities for working with the attachment files and their directories.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AttachmentUtils.AttachmentAdapter |
This class is deprecated.
Use AttachmentStore with AttachmentStore.AttachmentAdapter . Since v6.1
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | THUMBS_SUBDIR | Infix for generated thumbnail images. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks that the Attachment directory of the given issue is right to go - writable, accessible etc.
| |||||||||||
Get the attachment directory for the given attachment base directory, project key, and issue key.
| |||||||||||
Returns the physical directory of the attachments for the given issue.
| |||||||||||
Returns the physical directory of the attachments for the given issue.
| |||||||||||
Returns the physical File for the given Attachment.
| |||||||||||
Returns the physical File for the given Attachment.
| |||||||||||
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.
| |||||||||||
Returns the old legacy file name for thumbnails
http://jira.atlassian.com/browse/JRA-23311
| |||||||||||
Returns the physical directory of the thumbnails for the given issue, creating if necessary.
| |||||||||||
Just like the attachments themselves, thumbnails can succumb to file system encoding problems.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Infix for generated thumbnail images.
Checks that the Attachment directory of the given issue is right to go - writable, accessible etc. Will create it if necessary.
issue | the issue whose attachment directory to check. |
---|
AttachmentException | if the directory is not writable or missing and cannot be created. |
---|
Get the attachment directory for the given attachment base directory, project key, and issue key.
The idea is to encapsulate all of the path-joinery magic to make future refactoring easier if we ever decide to move away from attachment-base/project-key/issue-ketattachmentDirectory | base of attachments |
---|---|
projectKey | the project key the issue belongs to |
issueKey | the issue key for the issue |
Returns the physical directory of the attachments for the given issue. This will create it if necessary.
issue | the issue whose attachment directory you want. |
---|---|
createDirectory | If true, and the directory does not currently exist, then the directory is created. |
Returns the physical directory of the attachments for the given issue. This will create it if necessary.
issue | the issue whose attachment directory you want. |
---|
Returns the physical File for the given Attachment. This method performs better as it does not need to look up the issue object.
issue | the issue the attachment belongs to. |
---|---|
attachment | the attachment. |
DataAccessException | on failure getting required attachment info. |
---|
Returns the physical File for the given Attachment. If you are calling this on multiple attachments for the same issue, consider using the overriden method that passes in the issue. Else, this goes to the database for each call.
attachment | the attachment. |
---|
DataAccessException | on failure getting required attachment info. |
---|
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.
In practice, this is just used during Project Importattachment | 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" |
Returns the old legacy file name for thumbnails http://jira.atlassian.com/browse/JRA-23311
attachment | the attacment in play |
---|
Returns the physical directory of the thumbnails for the given issue, creating if necessary.
issue | the issue whose thumbnail directory you want. |
---|
Just like the attachments themselves, thumbnails can succumb to file system encoding problems. However we are going to regenerate thumbnails by only using the new naming scheme and not the legacy one. We can't do this for attachments, but we can for thumbnails since they are ephemeral objects anyway. http://jira.atlassian.com/browse/JRA-23311
attachment | the attacment in play |
---|