/// <summary> /// Get List of Source Folder Files /// </summary> public List <string> GetSourceFolderFiles() { EventLogMessage.WriteLogDebug("ConnectorFilesystem: GetSourceFolderFiles method"); // Read connection configuration _connectData = ConfigData.ReadConfigFileSystem(); string folderPath = (_connectData.SourceFolder.Last() == "\\"[0]) ? _connectData.SourceFolder : _connectData.SourceFolder + "\\"; EventLogMessage.WriteLogDebug("ConnectorFilesystem: GetSourceFolderFiles method, Source Folder Path: " + folderPath); return(new List <string>(Directory.EnumerateFiles(folderPath))); }
/// <summary> /// Delete All Source Folder Files /// </summary> public void DeleteSourceFolderFiles() { EventLogMessage.WriteLogDebug("ConnectorFilesystem: DeleteSourceFolderFiles method"); // Read connection configuration _connectData = ConfigData.ReadConfigFileSystem(); string folderPath = (_connectData.SourceFolder.Last() == "\\"[0]) ? _connectData.SourceFolder : _connectData.SourceFolder + "\\"; EventLogMessage.WriteLogDebug("ConnectorFilesystem: DeleteSourceFolderFiles method, Source Folder Path: " + folderPath); foreach (string sourceFile in Directory.EnumerateFiles(folderPath)) { EventLogMessage.WriteLog("Delete Source Folder File: " + sourceFile); File.Delete(sourceFile); } }