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{
12 [CollectionName("AgentContent")]
13 [Index("Account", "ContentId")]
14 public class ContentReference
15 {
20 {
21 }
22
26 [ObjectId]
27 public string ObjectId { get; set; }
28
32 public string Account { get; set; }
33
37 public string ContentId { get; set; }
38
42 public string FileExtension { get; set; }
43
47 public string ContentType { get; set; }
48
52 public long ContentLength { get; set; }
53
57 public byte[] Key { get; set; }
58
62 public byte[] IV { get; set; }
63
67 public DateTime Uploaded { get; set; }
68
72 public string ETag { get; set; }
73
77 public ContentVisibility Visibility { get; set; }
78
82 public bool Named { get; set; }
83
87 public string Url => Gateway.GetUrl("/Agent/Storage/Content/" + HttpUtility.UrlEncode(this.Account) + "/" +
88 this.ContentId + "." + this.FileExtension);
89
93 public string FileName => Path.Combine(Gateway.AppDataFolder, "AgentContent", this.Account,
94 this.ContentId.Replace('/', Path.DirectorySeparatorChar) + "." + this.FileExtension);
95 }
96}
Static class managing the runtime environment of the IoT Gateway.
Definition: Gateway.cs:147
static string AppDataFolder
Application data folder.
Definition: Gateway.cs:3132
static string GetUrl(string LocalResource)
Gets a URL for a resource.
Definition: Gateway.cs:5079
bool Named
If content was explicitly named by the agent.
ContentReference()
Reference to content, uploaded by an agent.