Table of Contents

Class IgnoreStrategy

Namespace
Amazon.CDK
Assembly
Amazon.CDK.dll

Represents file path ignoring behavior.

public abstract class IgnoreStrategy : DeputyBase
Inheritance
IgnoreStrategy
Derived

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");

Remarks

ExampleMetadata: fixture=_generated

Constructors

IgnoreStrategy()

protected IgnoreStrategy()

Methods

Add(string)

Adds another pattern.

public abstract void Add(string pattern)

Parameters

pattern string

Remarks

Params: pattern the pattern to add

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[]

Returns

DockerIgnoreStrategy

DockerIgnorePattern associated with the given patterns.

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 CopyOptions to create the IgnoreStrategy from.

absoluteRootPath string

the absolute path to the root directory of the paths to be considered.

Returns

IgnoreStrategy

IgnoreStrategy based on the CopyOptions

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[]

Returns

GitIgnoreStrategy

GitIgnorePattern associated with the given patterns.

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[]

Returns

GlobIgnoreStrategy

GlobIgnorePattern associated with the given patterns.

Ignores(string)

Determines whether a given file path should be ignored or not.

public abstract bool Ignores(string absoluteFilePath)

Parameters

absoluteFilePath string

absolute file path to be assessed against the pattern.

Returns

bool

true if the file should be ignored