public interface

AoImportTemporaryFiles

com.atlassian.jira.imports.project.util.AoImportTemporaryFiles
Known Indirect Subclasses

Class Overview

Single interface to hold the paths to the AO XML partition files, and their temporary parent directory.

Summary

Public Methods
File createFileForEntity(String entityName)
Creates a new the file object for an entity.
void deleteTempFiles()
Deletes the temporary files held in this object.
SortedMap<StringLong> getAOEntityWeights()
Returns a map from each AOEntity to the weight used for sorting the entity.
SortedMap<StringFile> getAOXmlFiles()
Returns a map from each AOEntity to the temporary XML partition file for the Entity.
File getFileForEntity(String entityName)
Returns the file registered for an entity.
File getParentDirectory()
Returns the temporary directory which is the parent of all the temporary partition files.
void registerAoEntities()
Register all the AO entities that are defined to be imported by plugins.
void registerAoXmlFile(String entityName, File file)
Record the entityName -> file mapping.

Public Methods

public File createFileForEntity (String entityName)

Creates a new the file object for an entity.

Parameters
entityName The name of the entity.
Returns
  • the temporary XML partition file.

public void deleteTempFiles ()

Deletes the temporary files held in this object. It is safe to call this method twice as it will check if the files actually exist first.

public SortedMap<StringLong> getAOEntityWeights ()

Returns a map from each AOEntity to the weight used for sorting the entity. The Entities are sorted according to the weight supplied by the plugin configurations.

Returns
  • the temporary XML partition file.

public SortedMap<StringFile> getAOXmlFiles ()

Returns a map from each AOEntity to the temporary XML partition file for the Entity. The Entities are sorted according to the weight supplied by the plugin configurations. Entities that have no import specification are sorted alphabetically to the end.

Returns
  • the temporary XML partition files map.

public File getFileForEntity (String entityName)

Returns the file registered for an entity.

Parameters
entityName The name of the entity.
Returns
  • the temporary XML partition file.

public File getParentDirectory ()

Returns the temporary directory which is the parent of all the temporary partition files.

Returns
  • the temporary directory which is the parent of all the temporary partition files.

public void registerAoEntities ()

Register all the AO entities that are defined to be imported by plugins. This allows us to set the correct sort order for processing the XML files later.

public void registerAoXmlFile (String entityName, File file)

Record the entityName -> file mapping.

Parameters
entityName The name of the entity.
file the temporary XML partition file.