C# Class DataMigration.FeedManager

FeedManager implements IFeedManager, an entity which, given an IFeedAccess instance can determine if feed work needs to be done, and move the files from CurrentToArchive, from Drop to Local, and download to the local file system. FeedManager works in tandem with IFeedAccess to manage this process.
Inheritance: IFeedManager
ファイルを表示 Open project: scoutmedia/DataMigration Class Usage Examples

Public Methods

Method Description
DownloadCurrentToLocal ( bool doDownload = true ) : void

Downloads the feed files in current to the local working directory to process. Alternatively, (if doDownload == false), it will simply locate the files already in the local working directory, and put appropriate FileInfo information in the DataSourcePlan for all files.

MoveCurrentToArchive ( ) : string

Moves all feed files from the 'current' subdirectory to the 'archive' location. The name of the dated subdirectory under archive.

MoveDropToCurrent ( ) : void

Moves all feed files from the 'drop' subfolder to the 'current' location.

NeedsToProcess ( ) : bool

Given a DataSourcePlan and an IFeedAccess instance, an IFeedManager is responsible for determining if there is work to do. This works on LastModifiedDates, comparing what is in the drop to the current.

Private Methods

Method Description
AssureWorkDirExists ( ) : string

Assures the Working Directory exists. It uses Environment.SpecialFolder.Personal, and adds a subdir as described in the Plan.

GetLastModified ( string fileLocation, string subDirectory, string fileName ) : DateTime?

Gets the last modified date for a single file.

GetLastModifiedStates ( ) : DateTime?>>.IList

Gets the last modifiedDate for each file in the current, and the drop.

MoveFeed ( string oldDirectory, string newDirectory, bool abortOnErr ) : void

Moves all files in a particular feed from the specified old dir to new dir.

Method Details

DownloadCurrentToLocal() public method

Downloads the feed files in current to the local working directory to process. Alternatively, (if doDownload == false), it will simply locate the files already in the local working directory, and put appropriate FileInfo information in the DataSourcePlan for all files.
public DownloadCurrentToLocal ( bool doDownload = true ) : void
doDownload bool If set to true do download.
return void

MoveCurrentToArchive() public method

Moves all feed files from the 'current' subdirectory to the 'archive' location. The name of the dated subdirectory under archive.
public MoveCurrentToArchive ( ) : string
return string

MoveDropToCurrent() public method

Moves all feed files from the 'drop' subfolder to the 'current' location.
public MoveDropToCurrent ( ) : void
return void

NeedsToProcess() public method

Given a DataSourcePlan and an IFeedAccess instance, an IFeedManager is responsible for determining if there is work to do. This works on LastModifiedDates, comparing what is in the drop to the current.
public NeedsToProcess ( ) : bool
return bool