Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -5,6 +5,7 @@ include ../../build/rules.make
LIBRARY = System.IO.Compression.dll
LIB_REFS = System System.Core
LIB_MCS_FLAGS = /unsafe
TEST_MCS_FLAGS = /r:System /r:System.Core
TEST_MCS_FLAGS =
TEST_LIB_REFS = System System.Core
include ../../build/library.make

View File

@@ -10,7 +10,6 @@ namespace SharpCompress.Archive.Zip
{
private readonly string path;
private readonly long size;
private readonly DateTime? lastModified;
private readonly bool closeStream;
private readonly Stream stream;
private bool isDisposed;
@@ -22,7 +21,7 @@ namespace SharpCompress.Archive.Zip
this.stream = stream;
this.path = path;
this.size = size;
this.lastModified = lastModified;
this.LastModifiedTime = lastModified;
this.closeStream = closeStream;
}
@@ -46,11 +45,6 @@ namespace SharpCompress.Archive.Zip
get { return size; }
}
public override DateTime? LastModifiedTime
{
get { return lastModified; }
}
public override DateTime? CreatedTime
{
get { return null; }

View File

@@ -91,4 +91,4 @@ ZipArchive.cs
ZipArchiveEntry.cs
ZipArchiveMode.cs
../../build/common/Consts.cs
../../build/common/MonoTODOAttribute.cs
../../build/common/MonoTODOAttribute.cs

View File

@@ -1 +1 @@
System.IO.Compression/ZipTest.cs
System.IO.Compression/ZipTest.cs

View File

@@ -238,6 +238,31 @@ namespace MonoTests.System.IO.Compression
File.Delete ("create.zip");
}
[Test]
public void ZipEnumerateEntriesModifiedTime()
{
File.Copy("archive.zip", "test.zip", overwrite: true);
var date = DateTimeOffset.Now;
using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
ZipArchiveMode.Update))
{
var entry = archive.GetEntry("foo.txt");
entry.LastWriteTime = date;
}
using (var archive = new ZipArchive(File.Open("test.zip", FileMode.Open),
ZipArchiveMode.Read))
{
var entry = archive.GetEntry("foo.txt");
Assert.AreEqual(entry.LastWriteTime.Year, date.Year);
Assert.AreEqual(entry.LastWriteTime.Month, date.Month);
Assert.AreEqual(entry.LastWriteTime.Day, date.Day);
}
File.Delete ("test.zip");
}
[Test]
public void ZipEnumerateArchiveDefaultLastWriteTime()
{