Namespace VpnHood.Net.Toolkit.Assets
Classes
- Asset
Represents the asset a provider serves at a path: the two as one value, to hand about. It answers what the provider answers.
- AssetNotFoundException
The exception that is thrown when there is no asset at a path. A type of its own, so the wording cannot drift and a caller that only asks can catch this and nothing else: a file that exists but will not open is a different failure.
- AssetProviderExtensions
Provides opening for a caller that only asks: null instead of AssetNotFoundException.
- CompositeAssetProvider
Provides several providers read as one: an asset is asked of each in turn, and the first that has it answers.
- EmbeddedResourceAssetProvider
Provides the assets an assembly carries as embedded resources, each named by the prefix followed by the asset path. They are in memory, so their streams can seek.
- FileAsset
Represents a file as an asset, for a caller that was given a path rather than a provider: a test, a tool, or an app that already knows where the file lies.
- FolderAssetProvider
Provides the assets under a folder, read where they lie: the folder beside an executable, an app bundle, or a folder something else unpacked.
- HttpAssetProvider
Provides the assets a web server serves, each at the base URL followed by the asset path, for a caller with nothing placed beside it.
- StampedZipArchive
Provides a new zip with its stamp in front (ZipStamp): the stamp's space goes first, the zip after it, and closing the archive fills the stamp in, so what writes the zip cannot leave it out.
- ZipAssetProvider
Provides the entries of a zip as assets: extracted once into a folder named after the zip's stamp (ZipStamp), and read from there as files.
- ZipStamp
Provides the stamp that names a zip's contents: in front of the zip,
VHSTAMP:, 16 hex digits and a newline. The digits are the first 16 hex digits of the SHA-256 of the whole file, taken while they were still zero, so the stamp can sit in what it hashes.
Interfaces
- IAsset
Represents one thing to open: a provider with its path already chosen. It names the asset, so a failure can name it, where a bare delegate could only say that something failed.
- IAssetProvider
Represents where a build's data files ended up on this platform, read by path: beside the executable, inside an app bundle, inside an Android package, or over HTTP for a page that has nothing placed beside it.