Class ManifestBuilder
- Namespace
- ZeroInstall.Store.Manifests
- Assembly
- ZeroInstall.Store.dll
Builds a Manifest for a file system directory.
public class ManifestBuilder : MarshalNoTimeout, IBuilder, IForwardOnlyBuilder
- Inheritance
-
objectMarshalByRefObjectManifestBuilder
- Implements
- Extension Methods
Constructors
ManifestBuilder(ManifestFormat)
Builds a Manifest for a file system directory.
public ManifestBuilder(ManifestFormat format)
Parameters
formatManifestFormatThe manifest format.
Properties
Manifest
The manifest.
public Manifest Manifest { get; }
Property Value
Methods
AddDirectory(string)
Adds a subdirectory to the implementation.
public void AddDirectory(string path)
Parameters
pathstringThe path of the directory to create relative to the implementation root.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
AddFile(string, Stream, UnixTime, bool)
Adds a file to the implementation.
public void AddFile(string path, Stream stream, UnixTime modifiedTime, bool executable = false)
Parameters
pathstringThe path of the file to create relative to the implementation root.
streamStreamThe contents of the file.
modifiedTimeUnixTimeThe last write time to set for the file.
executablebooltrueif the file's executable bit is to be set;falseotherwise.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
AddHardlink(string, string, bool)
Adds a hardlink to the implementation.
public void AddHardlink(string path, string target, bool executable = false)
Parameters
pathstringThe path of the hardlink to create relative to the implementation root.
targetstringThe path of the existing file the hardlink shall be based on relative to the implementation root. Must point
executablebooltrueif the executable bit of the hardlink is set;falseotherwise.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
- NotSupportedException
The currently platform or builder does not support hardlinks. Use AddFile(string, Stream, UnixTime, bool) instead.
AddSymlink(string, string)
Adds a symbolic link to the implementation.
public void AddSymlink(string path, string target)
Parameters
pathstringThe path of the symlink to create relative to the implementation root.
targetstringThe target the symbolic link shall point to relative to
path. May use non-native path separators.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
MarkAsExecutable(string)
Marks a previously added file as executable.
public void MarkAsExecutable(string path)
Parameters
pathstringThe path of the file to create relative to the implementation root.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
Remove(string)
Removes a file or directory from the implementation.
public void Remove(string path)
Parameters
pathstringThe path of the file or directory relative to the implementation root.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
Rename(string, string)
Renames a file or directory in the implementation.
public void Rename(string path, string target)
Parameters
pathstringThe original path of the file or directory relative to the implementation root.
targetstringThe new path of the file or directory relative to the implementation root.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
TryAddExternalHardlink(string, FileInfo, bool)
Tries to create a hardlink to an existing file from outside the implementation being built.
public bool TryAddExternalHardlink(string path, FileInfo target, bool executable = false)
Parameters
pathstringThe path of the hardlink to create relative to the implementation root.
targetFileInfoThe existing file to hardlink to. Must reside within an allowed root on the same filesystem.
executablebooltrueif the executable bit of the hardlink is set;falseotherwise.
Returns
- bool
trueif the hardlink was created;falseif hardlinks are not supported or the source is outside the allowed root.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.
TurnIntoSymlink(string)
Turns a previously added file into a symlink.
public void TurnIntoSymlink(string path)
Parameters
pathstringThe path of the symlink to create relative to the implementation root.
Exceptions
- UnauthorizedAccessException
Access to a resource was denied.
- IOException
An IO operation failed.