wasStitchNET – Diff between revs 13 and 20

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 13 Rev 20
Line 10... Line 10...
10 using System.Linq; 10 using System.Linq;
11 using System.Security.Cryptography; 11 using System.Security.Cryptography;
12 using System.Threading.Tasks; 12 using System.Threading.Tasks;
13 using wasDAVClient; 13 using wasDAVClient;
14 using wasSharp; 14 using wasSharp;
15 using wasSharp.Linq; 15 using wasSharp.Sets;
16 using wasSharp.Web.Utilities; 16 using wasSharp.Web.Utilities;
17 using wasSharpNET.IO.Utilities; 17 using wasSharpNET.IO.Utilities;
18 using wasStitchNET.Structures; 18 using wasStitchNET.Structures;
Line 19... Line 19...
19   19  
Line 32... Line 32...
32 public static IEnumerable<StitchFile> LoadRemoteFiles(Client client, string path, string basePath, 32 public static IEnumerable<StitchFile> LoadRemoteFiles(Client client, string path, string basePath,
33 char pathSeparator = '/') 33 char pathSeparator = '/')
34 { 34 {
35 Func<string, Task<StitchFile>> getStitchFile = async file => 35 Func<string, Task<StitchFile>> getStitchFile = async file =>
36 { 36 {
37 /*using (var memoryStream = new MemoryStream()) -  
38 { -  
39 using (var stream = await client.Download(file)) -  
40 { -  
41 await stream.CopyToAsync(memoryStream); -  
42 } -  
43 return new StitchFile -  
44 { -  
45 Path = -  
46 file.PathSplit(pathSeparator) -  
47 .Select(WebExtensions.URLUnescapeDataString) -  
48 .SequenceExcept( -  
49 basePath.PathSplit(pathSeparator)), -  
50 SHA1 = SHA1.Create().ToHex(memoryStream.ToArray()), -  
51 PathType = StitchPathType.PATH_FILE -  
52 }; -  
53 }*/ -  
54 using (var sha1managed = new SHA1Managed()) 37 using (var sha1managed = new SHA1Managed())
55 { 38 {
56 using (var stream = await client.Download(file)) 39 using (var stream = await client.Download(file))
57 { 40 {
58 //fileHash = sha1managed.ComputeHash(stream); 41 //fileHash = sha1managed.ComputeHash(stream);