Class ZipBuilder
- Namespace
- ZeroInstall.Archives.Builders
- Assembly
- ZeroInstall.Archives.dll
Builds a ZIP archive (.zip).
[MustDisposeResource]
public class ZipBuilder : IArchiveBuilder, IForwardOnlyBuilder, IDisposable
- Inheritance
-
ZipBuilder
- Implements
- Inherited Members
Constructors
ZipBuilder(Stream)
Builds a ZIP archive (.zip).
public ZipBuilder(Stream stream)
Parameters
stream
StreamThe stream to write the archive to. Will be disposed when the builder is disposed.
Methods
AddDirectory(string)
Adds a subdirectory to the implementation.
public void AddDirectory(string path)
Parameters
path
stringThe 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
path
stringThe path of the file to create relative to the implementation root.
stream
StreamThe contents of the file.
modifiedTime
UnixTimeThe last write time to set for the file.
executable
booltrue
if the file's executable bit is to be set;false
otherwise.
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
path
stringThe path of the hardlink to create relative to the implementation root.
target
stringThe path of the existing file the hardlink shall be based on relative to the implementation root. Must point
executable
booltrue
if the executable bit of the hardlink is set;false
otherwise.
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
path
stringThe path of the symlink to create relative to the implementation root.
target
stringThe 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.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()