com.atlassian.core.spool
Class DefaultSpoolFileFactory

java.lang.Object
  extended bycom.atlassian.core.spool.DefaultSpoolFileFactory
All Implemented Interfaces:
FileFactory

public class DefaultSpoolFileFactory
extends java.lang.Object
implements FileFactory

Default file factory for spooling. Creates a new temporary file via File::createTempFile(). The file is automatically scheduled for deletion via File::deleteOnExit()

See Also:
File.createTempFile(String, String, File), File.deleteOnExit()

Constructor Summary
DefaultSpoolFileFactory()
           
 
Method Summary
 java.io.File createNewFile()
          Create a new file based on the strategy of the factory.
static DefaultSpoolFileFactory getInstance()
           
 void setSpoolDirectory(java.io.File spoolDirectory)
           
 void setSpoolPrefix(java.lang.String spoolPrefix)
           
 void setSpoolSuffix(java.lang.String spoolSuffix)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSpoolFileFactory

public DefaultSpoolFileFactory()
Method Detail

getInstance

public static DefaultSpoolFileFactory getInstance()
Returns:
a singleton instance of this file factory, using default settings

setSpoolPrefix

public void setSpoolPrefix(java.lang.String spoolPrefix)

setSpoolSuffix

public void setSpoolSuffix(java.lang.String spoolSuffix)

setSpoolDirectory

public void setSpoolDirectory(java.io.File spoolDirectory)

createNewFile

public java.io.File createNewFile()
                           throws java.io.IOException
Description copied from interface: FileFactory
Create a new file based on the strategy of the factory. Factories should ensure that the file returned exists.

Specified by:
createNewFile in interface FileFactory
Returns:
A newly created file
Throws:
java.io.IOException


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.