com.atlassian.jira.imports.project.parser
Interface AttachmentParser

All Known Implementing Classes:
AttachmentParserImpl

public interface AttachmentParser

Converts issue attachment xml in a JIRA backup to an object representation.

Since:
v3.13

Field Summary
static String ATTACHMENT_ENTITY_NAME
           
 
Method Summary
 File getAttachmentDirectory(ExternalProject project, String issueKey)
           
 File getAttachmentFile(ExternalAttachment attachment, ExternalProject project, String issueKey)
          Returns the full path, on disk, to where the attachment file should be stored based on the provided inputs.
 boolean isUsingOriginalKeyPath(ExternalProject project)
           
 ExternalAttachment parse(Map<String,String> attributes)
          Parses the file attachment data from the backup XML.
 

Field Detail

ATTACHMENT_ENTITY_NAME

static final String ATTACHMENT_ENTITY_NAME
See Also:
Constant Field Values
Method Detail

parse

ExternalAttachment parse(Map<String,String> attributes)
                         throws ParseException
Parses the file attachment data from the backup XML.

Parameters:
attributes - is a map of key value pairs that represent the attributes of an ExternalAttachment. The following attributes are required, otherwise a ParseException will be thrown:
  • id (required)
  • issue (required)
  • filename (required)
  • created (required)
An optional attribute is:
  • author
Returns:
an ExternalAttachment if the attributes contain the required fields
Throws:
ParseException - if the required fields are not found in the attributes map

getAttachmentFile

File getAttachmentFile(ExternalAttachment attachment,
                       ExternalProject project,
                       String issueKey)
Returns the full path, on disk, to where the attachment file should be stored based on the provided inputs.

Parameters:
attachment - represents the database row for an attachment from the backup.
project - the backup project key, used to determine the path to the attachment file.
issueKey - the issue key that the attachment is associated with, used to determine the path to the attachment file.
Returns:
the full path, on disk, to where the attachment file should be stored based on the provided inputs.

getAttachmentDirectory

File getAttachmentDirectory(ExternalProject project,
                            String issueKey)

isUsingOriginalKeyPath

boolean isUsingOriginalKeyPath(ExternalProject project)


Copyright © 2002-2014 Atlassian. All Rights Reserved.