com.atlassian.jira.functest.framework.xmlbackup
Class XmlBackupCopier

java.lang.Object
  extended by com.atlassian.jira.functest.framework.xmlbackup.XmlBackupCopier

public class XmlBackupCopier
extends Object

This class is used to copy JIRA XML backups to the JIRA import directory.

Since:
v4.3

Constructor Summary
XmlBackupCopier(URL baseUrl)
          Creates a new XmlBackupCopier for the given base URL.
 
Method Summary
 boolean copyXmlBackupTo(String sourcePath, String destinationPath)
          Copies the input file to the JIRA import directory, substituting string tokens.
 boolean copyXmlBackupTo(String sourcePath, String destinationPath, Map<Pattern,String> substitutions)
          Copies the input file to the JIRA import directory, substituting string tokens.
protected  Map<Pattern,String> createBaseUrlSubstitution(String baseURL)
          The substitutions to make in the file in order to set the base URL correctly.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlBackupCopier

public XmlBackupCopier(URL baseUrl)
Creates a new XmlBackupCopier for the given base URL.

Parameters:
baseUrl - a String containing the base URL of the running JIRA instance
Method Detail

copyXmlBackupTo

public boolean copyXmlBackupTo(String sourcePath,
                               String destinationPath)
Copies the input file to the JIRA import directory, substituting string tokens. This method will also try to replace any occurrence of and with the value of baseUrl.

The string tokens that will be replaced are dictated by the contents of the substitutions parameter.

Parameters:
sourcePath - the absolute path of the source file
destinationPath - the absolute path of the destination file (will be created if it doesn't exist)
Returns:
true if at least one substitution was made

copyXmlBackupTo

public boolean copyXmlBackupTo(String sourcePath,
                               String destinationPath,
                               Map<Pattern,String> substitutions)
Copies the input file to the JIRA import directory, substituting string tokens. Apart from the given substitutions, this method will also try to replace any occurrence of and with the value of baseUrl.

The string tokens that will be replaced are dictated by the contents of the substitutions parameter.

Parameters:
sourcePath - the absolute path of the source file
destinationPath - the absolute path of the destination file (will be created if it doesn't exist)
substitutions - the substitutions that will be performed
Returns:
true if at least one substitution was made

createBaseUrlSubstitution

protected Map<Pattern,String> createBaseUrlSubstitution(String baseURL)
The substitutions to make in the file in order to set the base URL correctly.

Parameters:
baseURL - a String containing the base URL to set in the file
Returns:
a Map of substitutions


Copyright © 2002-2012 Atlassian. All Rights Reserved.