Class IgnoreStrategy
Represents file path ignoring behavior.
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class IgnoreStrategy : DeputyBase
Syntax (vb)
Public MustInherit Class IgnoreStrategy Inherits DeputyBase
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var ignoreStrategy = IgnoreStrategy.FromCopyOptions(new CopyOptions {
Exclude = new [] { "exclude" },
Follow = SymlinkFollowMode.NEVER,
IgnoreMode = IgnoreMode.GLOB
}, "absoluteRootPath");
Synopsis
Constructors
| IgnoreStrategy() | Represents file path ignoring behavior. |
Methods
| Add(string) | Adds another pattern. |
| CompletelyIgnores(string) | Determines whether a given directory path should be ignored and have all of its children ignored. |
| Docker(string, string[]) | Ignores file paths based on the |
| FromCopyOptions(ICopyOptions, string) | Creates an IgnoreStrategy based on the |
| Git(string, string[]) | Ignores file paths based on the |
| Glob(string, string[]) | Ignores file paths based on simple glob patterns. |
| Ignores(string) | Determines whether a given file path should be ignored or not. |
Constructors
IgnoreStrategy()
Represents file path ignoring behavior.
protected IgnoreStrategy()
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;
var ignoreStrategy = IgnoreStrategy.FromCopyOptions(new CopyOptions {
Exclude = new [] { "exclude" },
Follow = SymlinkFollowMode.NEVER,
IgnoreMode = IgnoreMode.GLOB
}, "absoluteRootPath");
Methods
Add(string)
Adds another pattern.
public abstract void Add(string pattern)
Parameters
- pattern string
Remarks
Params: pattern the pattern to add
CompletelyIgnores(string)
Determines whether a given directory path should be ignored and have all of its children ignored.
public virtual bool CompletelyIgnores(string absoluteDirectoryPath)
Parameters
- absoluteDirectoryPath string
absolute directory path to be assessed against the pattern.
Returns
true if the directory and all of its children should be ignored
Remarks
ExampleMetadata: fixture=_generated
Docker(string, string[])
Ignores file paths based on the .dockerignore specification.
public static DockerIgnoreStrategy Docker(string absoluteRootPath, string[] patterns)
Parameters
- absoluteRootPath string
the absolute path to the root directory of the paths to be considered.
- patterns string[]
the absolute path to the root directory of the paths to be considered.
Returns
DockerIgnorePattern associated with the given patterns.
Remarks
ExampleMetadata: fixture=_generated
FromCopyOptions(ICopyOptions, string)
Creates an IgnoreStrategy based on the ignoreMode and exclude in a CopyOptions.
public static IgnoreStrategy FromCopyOptions(ICopyOptions options, string absoluteRootPath)
Parameters
- options ICopyOptions
the
CopyOptionsto create theIgnoreStrategyfrom.- absoluteRootPath string
the absolute path to the root directory of the paths to be considered.
Returns
IgnoreStrategy based on the CopyOptions
Remarks
ExampleMetadata: fixture=_generated
Git(string, string[])
Ignores file paths based on the .gitignore specification.
public static GitIgnoreStrategy Git(string absoluteRootPath, string[] patterns)
Parameters
- absoluteRootPath string
the absolute path to the root directory of the paths to be considered.
- patterns string[]
the absolute path to the root directory of the paths to be considered.
Returns
GitIgnorePattern associated with the given patterns.
Remarks
ExampleMetadata: fixture=_generated
Glob(string, string[])
Ignores file paths based on simple glob patterns.
public static GlobIgnoreStrategy Glob(string absoluteRootPath, string[] patterns)
Parameters
- absoluteRootPath string
the absolute path to the root directory of the paths to be considered.
- patterns string[]
the absolute path to the root directory of the paths to be considered.
Returns
GlobIgnorePattern associated with the given patterns.
Remarks
ExampleMetadata: fixture=_generated