- Timestamp:
- 05/03/16 17:13:50 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Jobs/FileOpeningService.cs
r13740 r13827 1 1 using HeuristicLab.Clients.Hive.WebJobManager.ViewModels; 2 using HeuristicLab.Common; 3 using HeuristicLab.Optimization; 2 4 using Microsoft.AspNet.Hosting; 5 using Microsoft.AspNet.Mvc; 3 6 using System; 4 7 using System.Collections.Generic; 8 using System.IO; 5 9 using System.Linq; 6 10 using System.Threading; … … 41 45 vm = new FileOpeningViewModel(); 42 46 Job = new RefreshableJob(); 47 43 48 Job.Job.Name = "init"; 44 49 … … 75 80 return null; 76 81 } 82 public void SaveToFile(string file) 83 { 84 if(vm != null) 85 { 86 var uploads = Path.Combine(env.WebRootPath, "uploads", weblog.getServiceLocator(UserId).getHiveServiceClient().ClientCredentials.UserName.UserName, 87 "HiveChanged"); 88 Directory.CreateDirectory(uploads); 89 var cont = Job.HiveTasks.First().ItemTask.Item; 90 if (!file.EndsWith(".hl")) 91 file += ".hl"; 92 var fileloc = uploads + "\\" + file; 93 if(cont is Experiment) 94 ContentManager.Save((Experiment)cont, fileloc, false); 95 else if(cont is BatchRun) 96 ContentManager.Save((BatchRun)cont, fileloc, false); 97 else if(cont is Algorithm) 98 { 99 IAlgorithm t = (IAlgorithm)Job.HiveTasks.First().ItemTask.Item; 100 ContentManager.Save((IStorableContent)t, fileloc, false); 101 } 102 103 } 104 } 105 77 106 } 78 107 }
Note: See TracChangeset
for help on using the changeset viewer.