Summer.Batch.Infrastructure.Item.Util.FileUtils Class Reference

File operations helper. More...

Static Public Member Functions

static void SetUpOutputFile (FileInfo file, bool restarted, bool append, bool overwrite)
 Sets up an output file for batch processing. This method implements common logic for handling output files when starting or restarting file I/O. When starting output file processing, creates/overwrites new file. When restarting output file processing, checks whether file is writable. More...
 
static bool CreateNewFile (FileInfo file)
 Crates a new empty file if it does not already exist. More...
 
static void CopyDir (string sourceDirectory, string targetDirectory)
 Copy a directory to another directory. More...
 
static long CopyAll (DirectoryInfo source, DirectoryInfo target, long byteCounter, bool resetCounter)
 Copy a directory to another directory. Recursive. More...
 

Detailed Description

File operations helper.

Member Function Documentation

static long Summer.Batch.Infrastructure.Item.Util.FileUtils.CopyAll ( DirectoryInfo  source,
DirectoryInfo  target,
long  byteCounter,
bool  resetCounter 
)
static

Copy a directory to another directory. Recursive.

Parameters
source
target
byteCounter
resetCounter
static void Summer.Batch.Infrastructure.Item.Util.FileUtils.CopyDir ( string  sourceDirectory,
string  targetDirectory 
)
static

Copy a directory to another directory.

Parameters
sourceDirectory
targetDirectory
static bool Summer.Batch.Infrastructure.Item.Util.FileUtils.CreateNewFile ( FileInfo  file)
static

Crates a new empty file if it does not already exist.

Parameters
filethe FileInfo for the file to create
Returns
true if the file was actually created, false otherwise
static void Summer.Batch.Infrastructure.Item.Util.FileUtils.SetUpOutputFile ( FileInfo  file,
bool  restarted,
bool  append,
bool  overwrite 
)
static

Sets up an output file for batch processing. This method implements common logic for handling output files when starting or restarting file I/O. When starting output file processing, creates/overwrites new file. When restarting output file processing, checks whether file is writable.

Parameters
filethe FileInfo for the file to set up
restartedwhether the file processing is restarting
appendwhether the output must be append to the file if it already exists
overwritewhether the file should be overwritten if it exists (ignored during restart)

The documentation for this class was generated from the following file:
  • Summer.Batch.Infrastructure/Item/Util/FileUtils.cs