com.atlassian.confluence.importexport.impl
Class ConfluenceTempDirExportFileNameGenerator

java.lang.Object
  extended by com.atlassian.confluence.importexport.impl.ConfluenceTempDirExportFileNameGenerator
All Implemented Interfaces:
ExportFileNameGenerator

public class ConfluenceTempDirExportFileNameGenerator
extends Object
implements ExportFileNameGenerator

A file name generator that will create directories and filenames appropriate for the configured Confluence temporary directory.


Constructor Summary
ConfluenceTempDirExportFileNameGenerator(BootstrapManager bootstrapManager, String exportDirPrefix, String extension, String dateFormat, String timeFormat)
           
 
Method Summary
 File createExportDirectory()
          Create a unique directory within which an export operation can create any necessary files and final output.
 File getExportFile(String... differentiators)
           Generate a File that can be used to create an output.
 String getExportFileName(String... differentiators)
          Generate a unique file name encompassing the differentiator parameters supplied.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfluenceTempDirExportFileNameGenerator

public ConfluenceTempDirExportFileNameGenerator(BootstrapManager bootstrapManager,
                                                String exportDirPrefix,
                                                String extension,
                                                String dateFormat,
                                                String timeFormat)
Method Detail

createExportDirectory

public File createExportDirectory()
                           throws IOException
Description copied from interface: ExportFileNameGenerator
Create a unique directory within which an export operation can create any necessary files and final output. The client has no control over the naming of this directory.

Specified by:
createExportDirectory in interface ExportFileNameGenerator
Returns:
a File representing an directory which exists.
Throws:
IOException - if there is a problem creating the output directory.

getExportFileName

public String getExportFileName(String... differentiators)
Description copied from interface: ExportFileNameGenerator
Generate a unique file name encompassing the differentiator parameters supplied. Multiple calls with the same differentiator parameters will each result in unique file names.

Specified by:
getExportFileName in interface ExportFileNameGenerator
Parameters:
differentiators - 0 or more components that will be used in creation of the file name.
Returns:
a unique file name that may be created.

getExportFile

public File getExportFile(String... differentiators)
                   throws IOException
Description copied from interface: ExportFileNameGenerator

Generate a File that can be used to create an output. All necessary parent directories will be created as necessary meaning the supplied File simply has to be opened for writing.

This method is a convenient combination of ExportFileNameGenerator.createExportDirectory() and ExportFileNameGenerator.getExportFileName(String...).

Specified by:
getExportFile in interface ExportFileNameGenerator
Parameters:
differentiators - 0 or more components that will be used in creation of the file name.
Returns:
a File representing the export file to be created
Throws:
IOException - if there is a problem creating the output directory.


Copyright © 2003-2012 Atlassian. All Rights Reserved.