Now adding a file's MIME type when uploading. The MIME type is retrieved from the...
[pithos-ms-client] / trunk / Pithos.Network / ContainerInfo.cs
1 #region\r
2 /* -----------------------------------------------------------------------\r
3  * <copyright file="ContainerInfo.cs" company="GRNet">\r
4  * \r
5  * Copyright 2011-2012 GRNET S.A. All rights reserved.\r
6  *\r
7  * Redistribution and use in source and binary forms, with or\r
8  * without modification, are permitted provided that the following\r
9  * conditions are met:\r
10  *\r
11  *   1. Redistributions of source code must retain the above\r
12  *      copyright notice, this list of conditions and the following\r
13  *      disclaimer.\r
14  *\r
15  *   2. Redistributions in binary form must reproduce the above\r
16  *      copyright notice, this list of conditions and the following\r
17  *      disclaimer in the documentation and/or other materials\r
18  *      provided with the distribution.\r
19  *\r
20  *\r
21  * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS\r
22  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r
23  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
24  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR\r
25  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF\r
28  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\r
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\r
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
32  * POSSIBILITY OF SUCH DAMAGE.\r
33  *\r
34  * The views and conclusions contained in the software and\r
35  * documentation are those of the authors and should not be\r
36  * interpreted as representing official policies, either expressed\r
37  * or implied, of GRNET S.A.\r
38  * </copyright>\r
39  * -----------------------------------------------------------------------\r
40  */\r
41 #endregion\r
42 using System;\r
43 using System.Collections.Generic;\r
44 using Newtonsoft.Json;\r
45 using Pithos.Interfaces;\r
46 \r
47 namespace Pithos.Network\r
48 {\r
49     public class ContainerInfo\r
50     {\r
51         public string Account { get; set; }\r
52 \r
53         [JsonConverter(typeof(RelativeUriConverter))]\r
54         public Uri Name { get; set; }\r
55 \r
56         public string StorageUrl { get; set; }\r
57         public long Count { get; set; }\r
58         public long Bytes { get; set; }\r
59         public string BlockHash { get; set; }\r
60         public int BlockSize { get; set; }\r
61 \r
62         public DateTimeOffset? Last_Modified { get; set; }\r
63 \r
64         public Dictionary<string, string> Tags { get; set; }\r
65         public Dictionary<string, string> Policies { get; set; }\r
66 \r
67         public Uri AccountKey\r
68         {\r
69             get { return new Uri(StorageUrl).Combine("../" + Account); }\r
70         }\r
71 \r
72 \r
73         public static ContainerInfo Empty=new ContainerInfo();\r
74 \r
75         public ContainerInfo()\r
76         {\r
77             Tags = new Dictionary<string, string>();\r
78         }\r
79     }\r
80 }