root/trunk/nuxleus/Source/Xameleon/Function/S3ObjectCompare.cs

Revision 3980, 1.4 kB (checked in by xmlhacker, 1 year ago)

initial redistribution of class layout

Line 
1 using System;
2 using System.Diagnostics;
3 using System.Text;
4 using Nuxleus.Utility.S3;
5
6 namespace Xameleon.Function
7 {
8
9     public static class S3ObjectCompare
10     {
11
12         public static bool Compare(AWSAuthConnection connect, String bucket, String key, String compareTo)
13         {
14             bool compare = connect.get(bucket, key).Object.Data == compareTo;
15             if (compare)
16             {
17                 return true;
18             }
19             else
20             {
21                 Debug.Assert(compare);
22                 return false;
23             }
24         }
25
26         public static string DebugCompare(AWSAuthConnection connect, String bucket, String key, String compareTo)
27         {
28             StringBuilder builder = new StringBuilder();
29             String objectValue = connect.get(bucket, key).Object.Data;
30             builder.AppendLine("bucket: " + bucket);
31             builder.AppendLine("key: " + bucket);
32             builder.AppendLine("object value: " + objectValue);
33             builder.AppendLine("compare: " + compareTo);
34
35             if (objectValue == compareTo)
36             {
37                 builder.AppendLine("True: The objects are the same");
38             }
39             else
40             {
41                 builder.AppendLine("False: The objects are not the same");
42             }
43             return builder.ToString();
44         }
45
46     }
47 }
Note: See TracBrowser for help on using the browser.