- Timestamp:
- 08/07/19 14:44:13 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/HeuristicLab.HiveDrain/HeuristicLab.HiveDrain/JobDownloader.cs
r15347 r17194 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.Linq; 25 26 using System.Threading; 26 27 using HeuristicLab.Clients.Hive; … … 51 52 Semaphore limitSemaphore = new Semaphore(HeuristicLabHiveDrainApplication.MaxParallelDownloads, HeuristicLabHiveDrainApplication.MaxParallelDownloads); 52 53 54 var invalidChars = Path.GetInvalidFileNameChars(); 55 53 56 foreach (Job j in jobsLoaded) { 54 57 if (string.IsNullOrEmpty(NamePattern) || j.Name.Contains(NamePattern)) { 55 string jobPath = Path.Combine(RootLocation, String.Format("{0} - {1}", j.Name, j.Id));56 58 log.LogMessage(String.Format("\"{0}\": {1}", j.Name, j.Id)); 59 60 61 var jobName = j.Name; 62 //handle invalid characters in fileNames 63 if (invalidChars.Any(c => jobName.Contains(c))) { 64 log.LogMessage("Job name contains characters that cannot be used as filename. Invalid characters are replaced with '_'."); 65 foreach (var c in invalidChars) { 66 jobName = jobName.Replace(c, '_'); 67 } 68 } 69 70 string jobPath = Path.Combine(RootLocation, String.Format("{0} - {1}", jobName, j.Id)); 71 57 72 58 73 if (OneFile) { 59 74 JobTaskOneFileDownloader taskDownloader = new JobTaskOneFileDownloader(jobPath, j, limitSemaphore, log); 60 75 taskDownloader.Start(); 61 } else { 76 } 77 else { 62 78 JobTaskDownloader taskDownloader = new JobTaskDownloader(jobPath, j, limitSemaphore, log); 63 79 taskDownloader.Start(); 64 80 } 65 } else { 81 } 82 else { 66 83 log.LogMessage(String.Format("\"{0}\": {1} ---> ignored", j.Name, j.Id)); 67 84 }
Note: See TracChangeset
for help on using the changeset viewer.