Table of Contents

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

int

FileName

The feed document's conventional file name.

public const string FileName = "feed.json"

Field Value

string

FormatName

The value of a feed's format property.

public const string FormatName = "encdotnet-s100-feed"

Field Value

string

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

index SourceIndex

The index of the published folder, exchange set or dataset.

title string

The feed title.

generatedAt DateTimeOffset?

When the feed is generated; defaults to now.

Returns

S100FeedDocument

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

item CollectionItem

Returns

string

ItemPath(string)

The download path of an item with id, relative to the feed.

public static string ItemPath(string id)

Parameters

id string

Returns

string

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

stream Stream
feedUri Uri

Returns

S100FeedDocument

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

stream Stream
feed S100FeedDocument
indented bool