Class FileUtils

  extended by org.springframework.batch.item.util.FileUtils

public class FileUtils
extends Object

Utility methods for files used in batch processing.

Peter Zozom

Method Summary
static void setUpOutputFile(File file, boolean restarted, boolean overwriteOutputFile)
          Set up output file for batch processing.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static void setUpOutputFile(File file,
                                   boolean restarted,
                                   boolean overwriteOutputFile)
Set up output file for batch processing. This method implements common logic for handling output files when starting or restarting job/step. When starting output file processing, method creates/overwrites new file. When restarting output file processing, method checks whether file is writable.

file - file to be set up
restarted - TRUE signalizes that we are restarting output file processing
overwriteOutputFile - If set to TRUE, output file will be overwritten (this flag is ignored when processing is restart)
IllegalArgumentException - when file is NULL
IllegalStateException - when staring output file processing, file exists and flag "shouldDeleteExisting" is set to FALSE
DataAccessResourceFailureException - when unable to create file or file is not writable

Copyright © 2008 SpringSource. All Rights Reserved.