- Timestamp:
- 12/04/14 12:56:57 (10 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.Instances.Scheduling/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.Scheduling/3.3/HeuristicLab.Problems.Instances.Scheduling-3.3.csproj
r11623 r11650 113 113 <Private>False</Private> 114 114 </Reference> 115 <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.369">116 <HintPath>..\bin\ICSharpCode.SharpZipLib.dll</HintPath>117 <Private>False</Private>118 </Reference>119 115 <Reference Include="System" /> 120 116 <Reference Include="System.Core" /> 121 117 <Reference Include="System.Data" /> 118 <Reference Include="System.IO.Compression" /> 122 119 </ItemGroup> 123 120 <ItemGroup> -
trunk/sources/HeuristicLab.Problems.Instances.Scheduling/3.3/JSSPORLIBInstanceProvider.cs
r11171 r11650 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 27 using System.Reflection; 27 28 using System.Text.RegularExpressions; 28 using ICSharpCode.SharpZipLib.Zip;29 29 30 30 namespace HeuristicLab.Problems.Instances.Scheduling { … … 51 51 if (String.IsNullOrEmpty(instanceArchiveName)) yield break; 52 52 53 using (var instanceStream = new Zip InputStream(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {54 foreach (var entry in GetZipContents(instanceStream).OrderBy(x => x)) {53 using (var instanceStream = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 54 foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x)) { 55 55 yield return new JSSPORLIBDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetDescription(), entry, null); 56 56 } … … 61 61 var descriptor = (JSSPORLIBDataDescriptor)id; 62 62 var instanceArchiveName = GetResourceName("JSSPORLIB.zip"); 63 using (var instancesZipFile = new Zip File(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {63 using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 64 64 var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier); 65 65 66 using (var stream = instancesZipFile.GetInputStream(entry)) {66 using (var stream = entry.Open()) { 67 67 var parser = new JSSPORLIBParser(); 68 68 parser.Parse(stream); … … 124 124 .SingleOrDefault(x => Regex.Match(x, @".*\.Data\." + fileName).Success); 125 125 } 126 127 protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {128 ZipEntry entry;129 while ((entry = zipFile.GetNextEntry()) != null) {130 yield return entry.Name;131 }132 }133 126 } 134 127 }
Note: See TracChangeset
for help on using the changeset viewer.