Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ContentReference.cs
1using System;
2using System.IO;
3using System.Web;
6
8{
13 {
17 Public,
18
22 Presence,
23
27 Private
28 }
29
33 [CollectionName("AgentContent")]
34 [Index("Account", "ContentId")]
35 public class ContentReference
36 {
41 {
42 }
43
47 [ObjectId]
48 public string ObjectId { get; set; }
49
53 public string Account { get; set; }
54
58 public string ContentId { get; set; }
59
63 public string FileExtension { get; set; }
64
68 public string ContentType { get; set; }
69
73 public long ContentLength { get; set; }
74
78 public byte[] Key { get; set; }
79
83 public byte[] IV { get; set; }
84
88 public DateTime Uploaded { get; set; }
89
93 public string ETag { get; set; }
94
98 public ContentVisibility Visibility { get; set; }
99
103 public bool Named { get; set; }
104
108 public string Url => Gateway.GetUrl("/Agent/Storage/Content/" + HttpUtility.UrlEncode(this.Account) + "/" +
109 this.ContentId + "." + this.FileExtension);
110
114 public string FileName => Path.Combine(Gateway.AppDataFolder, "AgentContent", this.Account,
115 this.ContentId.Replace('/', Path.DirectorySeparatorChar) + "." + this.FileExtension);
116 }
117}
Static class managing the runtime environment of the IoT Gateway.
Definition: Gateway.cs:126
static string AppDataFolder
Application data folder.
Definition: Gateway.cs:2369
static string GetUrl(string LocalResource)
Gets a URL for a resource.
Definition: Gateway.cs:4167
bool Named
If content was explicitly named by the agent.
ContentReference()
Reference to content, uploaded by an agent.