public final class FileAttachments extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
computeIssueBucketDir(String issueKey)
Returns the bucket number for an issue based of its key
|
static String |
computeIssueKeyForOriginalProjectKey(String originalProjectKey,
String issueKey)
Helper method to mung an issue key to the given project key.
|
static File |
getAttachmentDirectoryForIssue(File rootDir,
String originalProjectKey,
String issueKey)
Returns the directory containing attachments for an issue.
|
static File |
getAttachmentFileHolder(AttachmentKey attachment,
File rootDir)
Returns a file that refers to an attachment specified by the given attachment key and the attachment root directory.
|
static File |
getAttachmentFileHolder(AttachmentStore.AttachmentAdapter attachment,
File attachmentDir)
Deprecated.
we should be using
getAttachmentFileHolder(AttachmentKey, java.io.File) once AttachmentStore is
removed. |
static File |
getDefaultAttachmentFileHolder(AttachmentKey attachment,
File rootDir)
Returns a file that refers to the default location of an attachment specified by the given attachment key
and the attachment root directory.
|
static File |
validateFileForAttachment(Attachment metaData,
File file) |
public static File getAttachmentDirectoryForIssue(File rootDir, String originalProjectKey, String issueKey)
rootDir - The root directory of all attachments.originalProjectKey - The project key that was used to store the attachments (i.e. the original project key)issueKey - The issue keypublic static String computeIssueKeyForOriginalProjectKey(String originalProjectKey, String issueKey)
originalProjectKey - The project key that the issue should be under.issueKey - The issue key to mung.public static File getAttachmentFileHolder(AttachmentKey attachment, File rootDir)
attachment - The attachment key.rootDir - The root directory of all attachments. NOT THE DIRECTORY FOR AN ISSUE'S ATTACHMENT.public static File getDefaultAttachmentFileHolder(AttachmentKey attachment, File rootDir)
attachment - The attachment key.rootDir - The root directory of all attachments. NOT THE DIRECTORY FOR AN ISSUE'S ATTACHMENT.@Deprecated public static File getAttachmentFileHolder(AttachmentStore.AttachmentAdapter attachment, File attachmentDir)
getAttachmentFileHolder(AttachmentKey, java.io.File) once AttachmentStore is
removed.attachment - The attachment adapterattachmentDir - The directory of issue's attachments. NOT THE ROOT DIRECTORY FOR ALL ATTACHMENTS.public static String computeIssueBucketDir(@Nonnull String issueKey)
issueKey - The latest issue keyIllegalArgumentException - if the issueKey is not a valid JIRA issue keypublic static File validateFileForAttachment(Attachment metaData, File file)
Copyright © 2002-2015 Atlassian. All Rights Reserved.