public class

AttachmentParserImpl

extends Object
implements AttachmentParser
java.lang.Object
   ↳ com.atlassian.jira.imports.project.parser.AttachmentParserImpl

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.imports.project.parser.AttachmentParser
Fields
protected final String attachmentPath
Public Constructors
AttachmentParserImpl(AttachmentStore attachmentStore, String attachmentPath)
Public Methods
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<StringString> attributes)
Parses the file attachment data from the backup XML.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.imports.project.parser.AttachmentParser

Fields

protected final String attachmentPath

Public Constructors

public AttachmentParserImpl (AttachmentStore attachmentStore, String attachmentPath)

Public Methods

public File getAttachmentDirectory (ExternalProject project, String issueKey)

public 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.

public boolean isUsingOriginalKeyPath (ExternalProject project)

public ExternalAttachment parse (Map<StringString> attributes)

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