Tp.Integration.Plugin.Common.Activity.PluginRollingFileAppender.GetExistingFiles C# (CSharp) Method

GetExistingFiles() private method

private GetExistingFiles ( string baseFilePath ) : IEnumerable
baseFilePath string
return IEnumerable
		private IEnumerable<string> GetExistingFiles(string baseFilePath)
		{
			var list = new List<string>();
			string path;

			using (SecurityContext.Impersonate(this))
			{
				string fullPath = Path.GetFullPath(baseFilePath);

				path = Path.GetDirectoryName(fullPath);

				if (Directory.Exists(path))
				{
					string fileName = Path.GetFileName(fullPath);
					string[] files = Directory.GetFiles(path, ActivityLogFile.GetWildcartPatternFor(fileName));

					list.AddRange(files.Select(Path.GetFileName));
				}
			}

			LogLog.Debug("RollingFileAppender: Searched for existing files in [" + path + "]");

			return list;
		}