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
 java.io.File createExportDirectory()
          Create a unique directory within which an export operation can create any necessary files and final output.
 java.io.File getExportFile(java.lang.String... differentiators)
           Generate a File that can be used to create an output.
 java.lang.String getExportFileName(java.lang.String... differentiators)
          Generate a unique file name encompassing the differentiator parameters supplied.
 

Method Detail

createExportDirectory

java.io.File createExportDirectory()
                                   throws java.io.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:
java.io.IOException - if there is a problem creating the output directory.

getExportFileName

java.lang.String getExportFileName(java.lang.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

java.io.File getExportFile(java.lang.String... differentiators)
                           throws java.io.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:
java.io.IOException - if there is a problem creating the output directory.


Copyright © 2003-2014 Atlassian. All Rights Reserved.