Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FileFolder.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4using Waher.Things;
7
9{
14 {
18 public FileFolder()
19 : base(null, null)
20 {
21 this.WebFolder = string.Empty;
22 this.FolderPath = string.Empty;
23 }
24
33 : base(Source, Parent)
34 {
35 this.WebFolder = WebFolder;
36 this.FolderPath = FolderPath;
37 }
38
42 [Page(7, "Configuration")]
43 [Header(48, "Web Folder:")]
44 [ToolTip(49, "Local resource that will be mapped to the file folder.")]
45 [Required]
46 public string WebFolder { get; set; }
47
51 [Page(7, "Configuration")]
52 [Header(50, "Folder Path:")]
53 [ToolTip(51, "Path to folder with contents.")]
54 [Required]
55 [Text(TextPosition.AfterField, 63, "Note: Changes will take effect after broker has been restarted.")]
56 public string FolderPath { get; set; }
57
61 public override string NodeId => this.WebFolder;
62
67 public override Task<string> GetTypeNameAsync(Language Language) => Language.GetStringAsync(typeof(GatewayConfigSource), 52, "File Folder");
68
74 public override Task<bool> AcceptsChildAsync(INode Child)
75 {
76 return Task.FromResult(Child is DefaultHttpResponseHeader);
77 }
78
84 public override Task<bool> AcceptsParentAsync(INode Parent)
85 {
86 return Task.FromResult(Parent is WebServer);
87 }
88
95 public override async Task<IEnumerable<Parameter>> GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
96 {
97 LinkedList<Parameter> Parameters = new LinkedList<Parameter>();
99
100 Parameters.AddLast(new StringParameter("Location", await Namespace.GetStringAsync(82, "Location"), this.FolderPath));
101
102 return Parameters;
103 }
104 }
105}
Contains information about a language.
Definition: Language.cs:17
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Definition: Language.cs:209
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Definition: Language.cs:99
Contains information about a namespace in a language.
Definition: Namespace.cs:17
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Definition: Namespace.cs:65
Abstract base class for gateway configuration nodes.
virtual INode Parent
Parent Node, or null if a root node.
GatewayConfigSource Source
Source hosting the node.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
Definition: FileFolder.cs:74
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
Definition: FileFolder.cs:95
string FolderPath
Path to folder with contents.
Definition: FileFolder.cs:56
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
Definition: FileFolder.cs:84
string WebFolder
Local resource that will be mapped to the file folder.
Definition: FileFolder.cs:46
FileFolder(GatewayConfigSource Source, WebServer Parent, string WebFolder, string FolderPath)
Defines a file folder.
Definition: FileFolder.cs:32
Tokens available in request.
Definition: RequestOrigin.cs:9
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49
TextPosition
Where the instructions are to be place.
Definition: TextAttribute.cs:9