com.atlassian.jira.imports.project.parser
Class AttachmentParserImpl

java.lang.Object
  extended by com.atlassian.jira.imports.project.parser.AttachmentParserImpl
All Implemented Interfaces:
AttachmentParser

public class AttachmentParserImpl
extends Object
implements AttachmentParser

Since:
v3.13

Field Summary
protected  String attachmentPath
           
 
Fields inherited from interface com.atlassian.jira.imports.project.parser.AttachmentParser
ATTACHMENT_ENTITY_NAME
 
Constructor Summary
AttachmentParserImpl(AttachmentStore attachmentStore, String attachmentPath)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attachmentPath

protected final String attachmentPath
Constructor Detail

AttachmentParserImpl

public AttachmentParserImpl(AttachmentStore attachmentStore,
                            String attachmentPath)
Method Detail

parse

public ExternalAttachment parse(Map<String,String> attributes)
                         throws ParseException
Description copied from interface: AttachmentParser
Parses the file attachment data from the backup XML.

Specified by:
parse in interface AttachmentParser
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

isUsingOriginalKeyPath

public boolean isUsingOriginalKeyPath(ExternalProject project)
Specified by:
isUsingOriginalKeyPath in interface AttachmentParser

getAttachmentDirectory

public File getAttachmentDirectory(ExternalProject project,
                                   String issueKey)
Specified by:
getAttachmentDirectory in interface AttachmentParser

getAttachmentFile

public File getAttachmentFile(ExternalAttachment attachment,
                              ExternalProject project,
                              String issueKey)
Description copied from interface: AttachmentParser
Returns the full path, on disk, to where the attachment file should be stored based on the provided inputs.

Specified by:
getAttachmentFile in interface AttachmentParser
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.


Copyright © 2002-2014 Atlassian. All Rights Reserved.