Skip to content

Commit

Permalink
add WithSubfolders(params string[]) to OptionsBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaskueffel committed Sep 19, 2024
1 parent cd440d3 commit e2df39b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FileSyncLibNet/FileCleanJob/FileCleanJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static IFileJob CreateJob(IFileCleanJobOptions fileCleanJobOptions)
// try
// {
// Dictionary<string, int> pathMaxDays = new Dictionary<string, int>();
// string[] subFolders = { "HriFFTLog", "HriShockLog", "HriLog", "HriDebugLog", "raw" };
//
// var driveInfo = new DriveInfo(Hauptprogramms.First().ProductionDataPath);
// int days = 59;

Expand Down
6 changes: 6 additions & 0 deletions FileSyncLibNet/FileSyncJob/FileSyncJobOptionsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public IFileSyncJobOptionsBuilderSetProperties WithSubfolder(string subfolder)
jobOptions.Subfolders.Add(subfolder);
return this;
}
public IFileSyncJobOptionsBuilderSetProperties WithSubfolders(params string[] subfolders)
{
jobOptions.Subfolders.AddRange(subfolders);
return this;
}
public IFileSyncJobOptionsBuilderSetProperties DeleteAfterBackup(bool deleteAfterBackup)
{
jobOptions.DeleteSourceAfterBackup = deleteAfterBackup;
Expand Down Expand Up @@ -136,6 +141,7 @@ public interface IFileSyncJobOptionsBuilderSetProperties : IFileSyncJobOptionsBu
IFileSyncJobOptionsBuilderSetProperties WithCredentials(NetworkCredential networkCredential);
IFileSyncJobOptionsBuilderSetProperties WithSearchPattern(string searchPattern);
IFileSyncJobOptionsBuilderSetProperties WithSubfolder(string subfolder);
IFileSyncJobOptionsBuilderSetProperties WithSubfolders(params string[] subfolders);
IFileSyncJobOptionsBuilderSetProperties DeleteAfterBackup(bool deleteAfterBackup);
IFileSyncJobOptionsBuilderSetProperties WithLogger(ILogger logger);
IFileSyncJobOptionsBuilderSetProperties WithLogger(Action<string> loggerAction);
Expand Down
2 changes: 1 addition & 1 deletion FileSyncLibNet/SyncProviders/FileIOProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ void EnsureAccess()
// catch { log.LogInformation($"Konnte nicht auf Backuppfad {backupTarget} schreiben"); canWrite = false; }
// }
// if (canWrite)
// foreach (string folder in new string[] { "HriFFTLog", "HriShockLog", "HriLog", "HriDebugLog", "HRI" })
//
// {
// string _path = Path.Combine(ProductionDataPath, folder);
// if (!Directory.Exists(_path))
Expand Down

0 comments on commit e2df39b

Please sign in to comment.