Class S100Feed
- Namespace
- EncDotNet.S100.Collections.Feeds
- Assembly
- EncDotNet.S100.Collections.dll
Builds, writes and reads S100FeedDocuments.
public static class S100Feed
- Inheritance
-
S100Feed
- Inherited Members
Fields
CurrentVersion
The format version this library writes.
public const int CurrentVersion = 1
Field Value
FileName
The feed document's conventional file name.
public const string FileName = "feed.json"
Field Value
FormatName
The value of a feed's format property.
public const string FormatName = "encdotnet-s100-feed"
Field Value
Methods
FromIndex(SourceIndex, string?, DateTimeOffset?)
Builds a feed from a local index: every item with a
LocalItemLocation whose base file is present is published
as items/<id>.zip; other items are left out.
public static S100FeedDocument FromIndex(SourceIndex index, string? title, DateTimeOffset? generatedAt = null)
Parameters
indexSourceIndexThe index of the published folder, exchange set or dataset.
titlestringThe feed title.
generatedAtDateTimeOffset?When the feed is generated; defaults to now.
Returns
ItemId(CollectionItem)
The opaque id an item is published under: a hash of its key, so the id never reveals (or can be used to reach) a path on the publisher.
public static string ItemId(CollectionItem item)
Parameters
itemCollectionItem
Returns
ItemPath(string)
The download path of an item with id, relative to the feed.
public static string ItemPath(string id)
Parameters
idstring
Returns
Read(Stream, Uri?)
Reads a feed, resolving its item URLs against feedUri
(where the feed was fetched from).
public static S100FeedDocument Read(Stream stream, Uri? feedUri = null)
Parameters
Returns
Exceptions
- JsonException
The content is not an S-100 feed.
- NotSupportedException
The feed is from a newer, unknown format version.
Write(Stream, S100FeedDocument, bool)
Writes feed as JSON, compact unless indented.
public static void Write(Stream stream, S100FeedDocument feed, bool indented = false)
Parameters
streamStreamfeedS100FeedDocumentindentedbool