com.atlassian.jira.bean.export
Class AutoExportImpl

java.lang.Object
  extended by com.atlassian.jira.bean.export.AutoExportImpl
All Implemented Interfaces:
AutoExport

public class AutoExportImpl
extends Object
implements AutoExport

Determines the best possible location (if any) and export all JIRA data to the chosen location using any provided filename generation strategy.


Field Summary
 
Fields inherited from interface com.atlassian.jira.bean.export.AutoExport
BASE_FILE_NAME, FIX_INVALID_XML_CHARACTERS
 
Constructor Summary
AutoExportImpl(String defaultDir)
          Creates an AutoExport that uses the given defaultDir and a datestamp filename generator.
AutoExportImpl(String defaultDir, FilenameGenerator filenameGenerator)
          Creates an AutoExport which uses the given defaultDir and filenameGenerator.
 
Method Summary
 String exportData()
          Attempts to choose the best location for export and exports the existing data This method tries to export to backup path, then to index path and the to the value of the "javax.servlet.context.tempdir" property of the passed in ServletContext
 String getExportFilePath()
          Tries the JIRA backup path, the configured JIRA index path and the servlet temp directory as candidate export file paths before failing.
protected  boolean isValidDirectory(String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoExportImpl

public AutoExportImpl(String defaultDir)
Creates an AutoExport that uses the given defaultDir and a datestamp filename generator.

Parameters:
defaultDir -

AutoExportImpl

public AutoExportImpl(String defaultDir,
                      FilenameGenerator filenameGenerator)
Creates an AutoExport which uses the given defaultDir and filenameGenerator.

Parameters:
defaultDir -
filenameGenerator -
Method Detail

exportData

public String exportData()
                  throws FileNotFoundException,
                         FileExistsException,
                         IllegalXMLCharactersException,
                         Exception
Attempts to choose the best location for export and exports the existing data This method tries to export to backup path, then to index path and the to the value of the "javax.servlet.context.tempdir" property of the passed in ServletContext

Specified by:
exportData in interface AutoExport
Returns:
the list of errors that occured duing the export
Throws:
FileNotFoundException - if the configured backup directory doesn't exist.
FileExistsException - if the backup filename configured to be used is already taken.
IllegalXMLCharactersException - if the backup data contains illegal characters for XML formatting.
Exception - for no good reason.

getExportFilePath

public String getExportFilePath()
                         throws FileNotFoundException,
                                FileExistsException,
                                IOException
Tries the JIRA backup path, the configured JIRA index path and the servlet temp directory as candidate export file paths before failing.

Specified by:
getExportFilePath in interface AutoExport
Returns:
the ultimate filepath decided.
Throws:
FileNotFoundException - if configuration of each option is a missing dir.
FileExistsException - if there is a file in the way of the generated path.
IOException - if there is a filesystem problem in determining the best path.

isValidDirectory

protected boolean isValidDirectory(String filename)


Copyright © 2002-2009 Atlassian. All Rights Reserved.