com.atlassian.jira.bean.export
Class AutoExportImpl
java.lang.Object
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.
Constructor Summary |
AutoExportImpl(String defaultDir)
Creates an AutoExport that uses the given defaultDir and a datestamp
filename generator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AutoExportImpl
public AutoExportImpl(String defaultDir)
- Creates an AutoExport that uses the given defaultDir and a datestamp
filename generator.
- Parameters:
defaultDir
-
exportData
public String exportData()
throws IOException,
FileExistsException,
IllegalXMLCharactersException,
com.atlassian.core.AtlassianCoreException
- 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.
IOException
com.atlassian.core.AtlassianCoreException
getJiraAuthContext
protected JiraAuthenticationContext getJiraAuthContext()
getExportService
protected ExportService getExportService()
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-2012 Atlassian. All Rights Reserved.