Log.Warning($"[PeriodicFileSystemWatcher.CheckSourceFolder] Find '{file}' does not exists");
continue;
}
Log.Debug($"[PeriodicFileSystemWatcher.CheckSourceFolder] Find new file {file}");
if(FSUtils.IsFileLocked(newFileInfo(file)))
{
continue;
}
stringtempFile;
try
{
Log.Debug($"[PeriodicFileSystemWatcher.CheckSourceFolder] Find new file {file}");
if(FSUtils.IsFileLocked(newFileInfo(file)))
{
continue;
}
stringtempFile;
try
tempFile=MoveToTemporary(file);
if(string.IsNullOrWhiteSpace(tempFile))
{
tempFile=MoveToTemporary(file);
if(string.IsNullOrWhiteSpace(tempFile))
{
Log.SystemWarning($"[PeriodicFileSystemWatcher.CheckSourceFolder] Failed to move file '{file}' to temporary directory '{_temporaryFolder}'. Without system error!");
continue;
}
}
catch(Exceptionex)
{
Log.SystemError(ex,$"[PeriodicFileSystemWatcher.CheckSourceFolder] Failed to attempt to move file '{file}' to temporary directory '{_temporaryFolder}'");
Log.SystemWarning($"[PeriodicFileSystemWatcher.CheckSourceFolder] Failed to move file '{file}' to temporary directory '{_temporaryFolder}'. Without system error!");
Log.SystemError(ex,$"[PeriodicFileSystemWatcher.CheckSourceFolder] Fault callback for file '{tempFile}'");
}
OnMovingFileToTemporary?.Invoke(file,tempFile);
}
catch(Exceptionex)
{
Log.SystemError(ex,$"[PeriodicFileSystemWatcher.CheckSourceFolder] Failed to attempt to move file '{file}' to temporary directory '{_temporaryFolder}'");