Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/04/14 12:56:57 (10 years ago)
Author:
ascheibe
Message:

#2247 switched persistence, instance providers, plugin infrastructure and MathJax to System.IO.Compression

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  
    113113      <Private>False</Private>
    114114    </Reference>
    115     <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.369">
    116       <HintPath>..\bin\ICSharpCode.SharpZipLib.dll</HintPath>
    117       <Private>False</Private>
    118     </Reference>
    119115    <Reference Include="System" />
    120116    <Reference Include="System.Core" />
    121117    <Reference Include="System.Data" />
     118    <Reference Include="System.IO.Compression" />
    122119  </ItemGroup>
    123120  <ItemGroup>
  • trunk/sources/HeuristicLab.Problems.Instances.Scheduling/3.3/JSSPORLIBInstanceProvider.cs

    r11171 r11650  
    2323using System.Collections.Generic;
    2424using System.IO;
     25using System.IO.Compression;
    2526using System.Linq;
    2627using System.Reflection;
    2728using System.Text.RegularExpressions;
    28 using ICSharpCode.SharpZipLib.Zip;
    2929
    3030namespace HeuristicLab.Problems.Instances.Scheduling {
     
    5151      if (String.IsNullOrEmpty(instanceArchiveName)) yield break;
    5252
    53       using (var instanceStream = new ZipInputStream(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)) {
    5555          yield return new JSSPORLIBDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetDescription(), entry, null);
    5656        }
     
    6161      var descriptor = (JSSPORLIBDataDescriptor)id;
    6262      var instanceArchiveName = GetResourceName("JSSPORLIB.zip");
    63       using (var instancesZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
     63      using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) {
    6464        var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier);
    6565
    66         using (var stream = instancesZipFile.GetInputStream(entry)) {
     66        using (var stream = entry.Open()) {
    6767          var parser = new JSSPORLIBParser();
    6868          parser.Parse(stream);
     
    124124        .SingleOrDefault(x => Regex.Match(x, @".*\.Data\." + fileName).Success);
    125125    }
    126 
    127     protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {
    128       ZipEntry entry;
    129       while ((entry = zipFile.GetNextEntry()) != null) {
    130         yield return entry.Name;
    131       }
    132     }
    133126  }
    134127}
Note: See TracChangeset for help on using the changeset viewer.