Skip to content
Snippets Groups Projects
Commit 1639bfdb authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Enter commit message

parent 84f480b1
No related branches found
No related tags found
No related merge requests found
......@@ -185,5 +185,20 @@ namespace ATXCommon
Log.Error("Error collecting orphaned files: {0}\n{1}", ex.Message, ex.StackTrace);
}
}
/// <summary>
/// Ensure the required spooling directories (managed/incoming) exist.
/// </summary>
/// <param name="incoming">The path to the incoming location.</param>
/// <param name="managed">The path to the managed location.</param>
/// <returns>True if all dirs exist or were created successfully.</returns>
public static bool CheckSpoolingDirectories(string incoming, string managed) {
var retval = CheckForDirectory(incoming);
retval &= CheckForDirectory(managed);
retval &= CheckForDirectory(Path.Combine(managed, "PROCESSING"));
retval &= CheckForDirectory(Path.Combine(managed, "DONE"));
retval &= CheckForDirectory(Path.Combine(managed, "UNMATCHED"));
return retval;
}
}
}
......@@ -255,7 +255,7 @@ namespace AutoTx
SetupMailLogging();
var configInvalid = false;
if (CheckSpoolingDirectories() == false) {
if (FsUtils.CheckSpoolingDirectories(_incomingPath, _managedPath) == false) {
Log.Error("ERROR checking spooling directories (incoming / managed)!");
configInvalid = true;
}
......@@ -785,19 +785,6 @@ namespace AutoTx
return true;
}
/// <summary>
/// Ensure the required spooling directories (managed/incoming) exist.
/// </summary>
/// <returns>True if all dirs exist or were created successfully.</returns>
private bool CheckSpoolingDirectories() {
var retval = FsUtils.CheckForDirectory(_incomingPath);
retval &= FsUtils.CheckForDirectory(_managedPath);
retval &= FsUtils.CheckForDirectory(Path.Combine(_managedPath, "PROCESSING"));
retval &= FsUtils.CheckForDirectory(Path.Combine(_managedPath, "DONE"));
retval &= FsUtils.CheckForDirectory(Path.Combine(_managedPath, "UNMATCHED"));
return retval;
}
/// <summary>
/// Helper to create directories for all users that have one in the local
/// user directory (C:\Users) AND in the DestinationDirectory.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment