com.atlassian.confluence.importexport.impl
Interface ExportFileNameGenerator

All Known Implementing Classes:
ConfluenceTempDirExportFileNameGenerator

public interface ExportFileNameGenerator

An interface for a class which can generate meaningful and unique (for a single VM) names that may be used as file names in the export process.


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.
 

Method Detail

createExportDirectory

File createExportDirectory()
                           throws IOException
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.

Returns:
a File representing an directory which exists.
Throws:
IOException - if there is a problem creating the output directory.

getExportFileName

String getExportFileName(String... differentiators)
Generate a unique file name encompassing the differentiator parameters supplied. Multiple calls with the same differentiator parameters will each result in unique file names.

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

File getExportFile(String... differentiators)
                   throws IOException

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 createExportDirectory() and getExportFileName(String...).

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-2011 Atlassian. All Rights Reserved.