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
Afficher le fichier Open project: scoutmedia/DataMigration Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat void

MoveCurrentToArchive() public méthode

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

MoveDropToCurrent() public méthode

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

NeedsToProcess() public méthode

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
Résultat bool