/Repository/Hashing.cs |
@@ -4,6 +4,7 @@ |
// rights of fair usage, the disclaimer and warranty conditions. // |
/////////////////////////////////////////////////////////////////////////// |
|
using System.Collections.Generic; |
using System.IO; |
using System.Linq; |
using System.Net; |
@@ -10,6 +11,7 @@ |
using System.Security.Cryptography; |
using System.Threading.Tasks; |
using wasDAVClient; |
using wasDAVClient.Model; |
using wasSharp; |
using wasSharpNET.IO.Utilities; |
|
@@ -32,11 +34,8 @@ |
foreach (var stream in Directory |
.GetFiles(path, "*.*", SearchOption.AllDirectories) |
.OrderBy(o => o.Split(Path.DirectorySeparatorChar).Last()) |
.AsParallel() |
.AsOrdered() |
.Select(file => IOExtensions.GetWriteStream(file, FileMode.Open, |
FileAccess.Read, FileShare.Read, STITCH_CONSTANTS.LOCAL_FILE_ACCESS_TIMEOUT)) |
.AsSequential()) |
FileAccess.Read, FileShare.Read, STITCH_CONSTANTS.LOCAL_FILE_ACCESS_TIMEOUT))) |
using (var binaryReader = new BinaryReader(stream)) |
{ |
var buff = new byte[bufferSize]; |
@@ -85,13 +84,11 @@ |
{ |
using (var sha1managed = new SHA1Managed()) |
{ |
//var list = new List<Item>(); |
foreach (var stream in (await client.List(path, Constants.DavDepth.ALL)) |
.OrderBy(o => o.DisplayName) |
.Where(item => !item.IsCollection) |
.AsParallel() |
.AsOrdered() |
.Select(file => client.Download(file.Href)) |
.AsSequential()) |
.Select(file => client.Download(file.Href))) |
using (var binaryReader = new BinaryReader(await stream)) |
{ |
var buff = new byte[bufferSize]; |