|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.attachment.FileSystemAttachmentDirectoryAccessor
public class FileSystemAttachmentDirectoryAccessor
Implementation of the AttachmentDirectoryAccessor that deals with filesystem-based attachment storage.
Field Summary | |
---|---|
protected ProjectManager |
projectManager
|
Constructor Summary | |
---|---|
FileSystemAttachmentDirectoryAccessor(ProjectManager projectManager,
AttachmentPathManager attachmentPathManager)
|
Method Summary | |
---|---|
void |
checkValidAttachmentDirectory(Issue issue)
Checks that the Attachment directory of the given issue is right to go - writable, accessible etc. |
void |
checkValidTemporaryAttachmentDirectory()
Checks that the temporary directory where attachments can be uploaded is writeable. |
com.atlassian.fugue.Option<ErrorCollection> |
errors()
Checks that the attachment root directory and the temporary attachment directories exist and are writeable. |
File |
getAttachmentDirectory(Issue issue)
Returns the physical directory of the attachments for the given issue. |
File |
getAttachmentDirectory(Issue issue,
boolean createDirectory)
Returns the physical directory of the attachments for the given issue. |
File |
getAttachmentDirectory(String issueKey)
|
File |
getAttachmentDirectory(String attachmentDirectory,
String projectKey,
String issueKey)
Get the attachment directory for the given attachment base directory, project key, and issue key. |
File |
getAttachmentRootPath()
Returns the path used to store all attachments across the system. |
File |
getTemporaryAttachmentDirectory()
|
File |
getThumbnailDirectory(Issue issue)
Returns the physical directory of the thumbnails for the given issue, creating if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ProjectManager projectManager
Constructor Detail |
---|
public FileSystemAttachmentDirectoryAccessor(ProjectManager projectManager, AttachmentPathManager attachmentPathManager)
Method Detail |
---|
@Nonnull public File getThumbnailDirectory(@Nonnull Issue issue)
getThumbnailDirectory
in interface AttachmentDirectoryAccessor
issue
- the issue whose thumbnail directory you want
public File getAttachmentDirectory(@Nonnull Issue issue)
getAttachmentDirectory
in interface AttachmentDirectoryAccessor
issue
- the issue whose attachment directory you want (required)
@Nullable public File getAttachmentDirectory(@Nonnull String issueKey)
getAttachmentDirectory
in interface AttachmentDirectoryAccessor
public File getAttachmentDirectory(@Nonnull Issue issue, boolean createDirectory)
getAttachmentDirectory
in interface AttachmentDirectoryAccessor
issue
- the issue whose attachment directory you wantcreateDirectory
- If true, and the directory does not currently exist, then the directory is created.
public File getTemporaryAttachmentDirectory()
getTemporaryAttachmentDirectory
in interface AttachmentDirectoryAccessor
public File getAttachmentDirectory(String attachmentDirectory, String projectKey, String issueKey)
getAttachmentDirectory
in interface AttachmentDirectoryAccessor
attachmentDirectory
- base of attachmentsprojectKey
- the project key the issue belongs toissueKey
- the issue key for the issue
public void checkValidAttachmentDirectory(Issue issue) throws AttachmentException
checkValidAttachmentDirectory
in interface AttachmentDirectoryAccessor
issue
- the issue whose attachment directory to check.
AttachmentException
- if the directory is not writable or missing and cannot be created.public void checkValidTemporaryAttachmentDirectory() throws AttachmentException
AttachmentDirectoryAccessor
checkValidTemporaryAttachmentDirectory
in interface AttachmentDirectoryAccessor
AttachmentException
- if the directory is not writable or missing and cannot be created.public File getAttachmentRootPath()
AttachmentDirectoryAccessor
getAttachmentRootPath
in interface AttachmentDirectoryAccessor
public com.atlassian.fugue.Option<ErrorCollection> errors()
errors
in interface AttachmentHealth
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |