AddCommand Class

Summary

Adds files to archive. (Command: a).

The builder is AddCommandBuilder.

graph BT Type-->Base0["BaseAddLikeSyntaxCommand"] click Base0 "/api/Cake.SevenZip.Commands/BaseAddLikeSyntaxCommand" Base0-->Base1["BaseCommand"] click Base1 "/api/Cake.SevenZip.Commands/BaseCommand" Base1-->Base2["Object"] Type-.->Interface0["IHaveArgumentArchive"] click Interface0 "/api/Cake.SevenZip.Arguments/IHaveArgumentArchive" Type-.->Interface1["IHaveArgumentFiles"] click Interface1 "/api/Cake.SevenZip.Arguments/IHaveArgumentFiles" Type-.->Interface2["IHaveArgumentDirectories"] click Interface2 "/api/Cake.SevenZip.Arguments/IHaveArgumentDirectories" Type-.->Interface3["IHaveArgument"] click Interface3 "/api/Cake.SevenZip.Arguments/IHaveArgument" Type-.->Interface4["ICommand"] click Interface4 "/api/Cake.SevenZip.Commands/ICommand" Type-.->Interface5["ISupportSwitchVolume"] click Interface5 "/api/Cake.SevenZip.Switches/ISupportSwitchVolume" Type-.->Interface6["ISupportSwitchCompressionMethod"] click Interface6 "/api/Cake.SevenZip.Switches/ISupportSwitchCompressionMethod" Type-.->Interface7["ISupportSwitchArchiveType"] click Interface7 "/api/Cake.SevenZip.Switches/ISupportSwitchArchiveType" Type-.->Interface8["ISupportSwitchPassword"] click Interface8 "/api/Cake.SevenZip.Switches/ISupportSwitchPassword" Type-.->Interface9["ISupportSwitchNtSecurityInformation"] click Interface9 "/api/Cake.SevenZip.Switches/ISupportSwitchNtSecurityInformation" Type-.->Interface10["ISupportSwitchNtfsAlternateStreams"] click Interface10 "/api/Cake.SevenZip.Switches/ISupportSwitchNtfsAlternateStreams" Type-.->Interface11["ISupportSwitchCompressFilesOpenForWriting"] click Interface11 "/api/Cake.SevenZip.Switches/ISupportSwitchCompressFilesOpenForWriting" Type-.->Interface12["ISupportSwitchTimestampFromMostRecentFile"] click Interface12 "/api/Cake.SevenZip.Switches/ISupportSwitchTimestampFromMostRecentFile" Type-.->Interface13["ISupportSwitchWorkingDirectory"] click Interface13 "/api/Cake.SevenZip.Switches/ISupportSwitchWorkingDirectory" Type-.->Interface14["ISupportSwitchRecurseSubdirectories"] click Interface14 "/api/Cake.SevenZip.Switches/ISupportSwitchRecurseSubdirectories" Type-.->Interface15["ISupportSwitchIncludeFilenames"] click Interface15 "/api/Cake.SevenZip.Switches/ISupportSwitchIncludeFilenames" Type-.->Interface16["ISupportSwitchExcludeFilenames"] click Interface16 "/api/Cake.SevenZip.Switches/ISupportSwitchExcludeFilenames" Type-.->Interface17["ISupportSwitchUpdateOptions"] click Interface17 "/api/Cake.SevenZip.Switches/ISupportSwitchUpdateOptions" Type-.->Interface18["ISupportSwitchDeleteAfterCompression"] click Interface18 "/api/Cake.SevenZip.Switches/ISupportSwitchDeleteAfterCompression" Type-.->Interface19["ISupportSwitchSelfExtractingArchive"] click Interface19 "/api/Cake.SevenZip.Switches/ISupportSwitchSelfExtractingArchive" Type-.->Interface20["ISupportSwitchFullyQualifiedFilePaths"] click Interface20 "/api/Cake.SevenZip.Switches/ISupportSwitchFullyQualifiedFilePaths" Type-.->Interface21["ISupportSwitch"] click Interface21 "/api/Cake.SevenZip.Switches/ISupportSwitch" Type["AddCommand"] class Type type-node

Syntax

public sealed class AddCommand : BaseAddLikeSyntaxCommand, IHaveArgumentArchive, 
    IHaveArgumentFiles, IHaveArgumentDirectories, IHaveArgument, ICommand, ISupportSwitchVolume, 
    ISupportSwitchCompressionMethod, ISupportSwitchArchiveType, ISupportSwitchPassword, 
    ISupportSwitchNtSecurityInformation, ISupportSwitchNtfsAlternateStreams, 
    ISupportSwitchCompressFilesOpenForWriting, ISupportSwitchTimestampFromMostRecentFile, 
    ISupportSwitchWorkingDirectory, ISupportSwitchRecurseSubdirectories, 
    ISupportSwitchIncludeFilenames, ISupportSwitchExcludeFilenames, ISupportSwitchUpdateOptions, 
    ISupportSwitchDeleteAfterCompression, ISupportSwitchSelfExtractingArchive, 
    ISupportSwitchFullyQualifiedFilePaths, ISupportSwitch

Attributes

Type Description
NullableContextAttribute
NullableAttribute

Constructors

Name Summary
AddCommand()

Properties

Name Value Summary
Archive FilePath
Sets the archive the command operates on.
ArchiveType SwitchArchiveType
Gets or sets the SwitchArchiveType.
CommandChar string
Gets the command character. (e.g. "a", "u" or "e"...)
CommandName string
Gets the name of the command. (i.e. "add", "update" or "extract".)
CompressFilesOpenForWriting SwitchCompressFilesOpenForWriting
Gets or sets the SwitchCompressFilesOpenForWriting.
CompressionMethod SwitchCompressionMethod
Gets or sets the compression method.
DeleteAfterCompression SwitchDeleteAfterCompression
Gets or sets the SwitchDeleteAfterCompression.
Directories DirectoryPathCollection
Gets or sets the list of Directories the command operates on.

For add and update, adding a directory will add the directory itself to the root of the archive including everything in it.

DirectoryContents DirectoryPathCollection
Gets or sets the list of Directory-contents the command operates on.

For add and update, adding a directory this way will add the files of the directory to the root of the archive but not the directory itself.

ExcludeFilenames SwitchExcludeFilenameCollection
Gets or sets the SwitchExcludeFilenameCollection.
Files FilePathCollection
Gets or sets the list of files this command operates on. These are single files. (I.e. to add to, or to remove from the archive).

For add and update, single files from the file-system will always be placed directly into the archive without any directory-structure.

Setting Files like this in add/update:
Files = new[] {
  new FilePath("C:\\some\\place\\a.txt"),
  new FilePath("C:\\some\\other\\place\\b.txt"),
  new FilePath("C:\\a\\totally\\different\\place\\c.txt")
};
Will result in an archive:
Archive.zip
- a.txt
- b.txt
- c.txt
without any directory structure.
FullyQualifiedFilePaths SwitchFullyQualifiedFilePaths
Gets or sets the SwitchFullyQualifiedFilePaths.
IncludeFilenames SwitchIncludeFilenameCollection
Gets or sets the SwitchIncludeFilenameCollection.
NtfsAlternateStreams SwitchNtfsAlternateStreams
Gets or sets the SwitchNtfsAlternateStreams.
NtSecurityInformation SwitchNtSecurityInformation
Gets or sets the SwitchNtSecurityInformation.
Password SwitchPassword
Gets or sets the SwitchPassword.
RecurseSubdirectories SwitchRecurseSubdirectories
Gets or sets the SwitchRecurseSubdirectories.
SelfExtractingArchive SwitchSelfExtractingArchive
Gets or sets the SwitchSelfExtractingArchive.
Switches IEnumerable<ISwitch>
Gets all supported switches.
ThrowOnMissingInputFiles bool
Gets a value indicating whether to throw on missing input files.
TimestampFromMostRecentFile SwitchSetTimestampFromMostRecentFile
Gets or sets the SwitchSetTimestampFromMostRecentFile.
UpdateOptions SwitchUpdateOptions
Gets or sets the SwitchUpdateOptions.
Volumes SwitchVolumeCollection
Gets or sets the SwitchVolumeCollection.
WorkingDirectory SwitchWorkingDirectory
Gets or sets the SwitchWorkingDirectory.

Methods

Name Value Summary
BuildArgumentParams(ProcessArgumentBuilder) void
adds only the arguments to the builder. (i.e. Archive, files, directories).
BuildArguments(ProcessArgumentBuilder) void
Builds the arguments.
Inherited from BaseCommand

Extension Methods

Name Value Summary
Dump<AddCommand>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<AddCommand>(AddCommand[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<AddCommand>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<AddCommand>(string) void
Requires the Cake.Issues addin
ThrowIfNull<AddCommand>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<AddCommand>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Requires the Cake.Issues addin