com.atlassian.jira.util
Class AttachmentUtils

java.lang.Object
  extended by com.atlassian.jira.util.AttachmentUtils

public class AttachmentUtils
extends Object

Static utilities for working with the attachment files and their directories.


Constructor Summary
AttachmentUtils()
           
 
Method Summary
static void checkValidAttachmentDirectory(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. use checkValidAttachmentDirectory(com.atlassian.jira.issue.Issue) TODO: remove in 4.2
static void checkValidAttachmentDirectory(Issue issue)
          Checks that the Attachment directory of the given issue is right to go - writable, accessible etc.
static File getAttachmentDirectory(org.ofbiz.core.entity.GenericValue issue)
          Deprecated. use getAttachmentDirectory(com.atlassian.jira.issue.Issue) TODO: remove in 4.2
static File getAttachmentDirectory(Issue issue)
          Returns the physical directory of the attachments for the given issue.
static File getAttachmentFile(Attachment attachment)
          Returns the physical File for the given Attachment.
static File getThumbnailFile(Attachment attachment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentUtils

public AttachmentUtils()
Method Detail

getAttachmentDirectory

public static File getAttachmentDirectory(org.ofbiz.core.entity.GenericValue issue)
                                   throws DataAccessException
Deprecated. use getAttachmentDirectory(com.atlassian.jira.issue.Issue) TODO: remove in 4.2

Parameters:
issue - the issue.
Returns:
The issue's attachment directory. This will create it if necessary
Throws:
DataAccessException - on failure getting required project or issue info.

getAttachmentDirectory

public static File getAttachmentDirectory(Issue issue)
                                   throws AttachmentException
Returns the physical directory of the attachments for the given issue. This will create it if necessary.

Parameters:
issue - the issue whose attachment directory you want.
Returns:
The issue's attachment directory.
Throws:
AttachmentException - if the directory cannot be determined.

getAttachmentFile

public static File getAttachmentFile(Attachment attachment)
                              throws DataAccessException
Returns the physical File for the given Attachment.

Parameters:
attachment - the attachment.
Returns:
the file.
Throws:
DataAccessException - on failure getting required attachment info.

getThumbnailFile

public static File getThumbnailFile(Attachment attachment)
                             throws DataAccessException
Throws:
DataAccessException

checkValidAttachmentDirectory

public static void checkValidAttachmentDirectory(org.ofbiz.core.entity.GenericValue issue)
                                          throws AttachmentException
Deprecated. use checkValidAttachmentDirectory(com.atlassian.jira.issue.Issue) TODO: remove in 4.2

Parameters:
issue - the issue.
Throws:
AttachmentException - if the atttachment directory is invalid or not writable.

checkValidAttachmentDirectory

public static void checkValidAttachmentDirectory(Issue issue)
                                          throws AttachmentException
Checks that the Attachment directory of the given issue is right to go - writable, accessible etc. Will create it if necessary.

Parameters:
issue - the issue whose attachment directory to check.
Throws:
AttachmentException - if the directory is not writable or missing and cannot be created.


Copyright © 2002-2008 Atlassian. All Rights Reserved.