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() | |
IgnoreStrategy(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
IgnoreStrategy(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Add(String) | Adds another pattern. |
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()
protected IgnoreStrategy()
IgnoreStrategy(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected IgnoreStrategy(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
IgnoreStrategy(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected IgnoreStrategy(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Add(String)
Adds another pattern.
public abstract void Add(string pattern)
Parameters
- pattern System.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 System.String
the absolute path to the root directory of the paths to be considered.
- patterns System.String[]
the absolute path to the root directory of the paths to be considered.
Returns
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 theIgnoreStrategy
from.- absoluteRootPath System.String
the absolute path to the root directory of the paths to be considered.
Returns
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 System.String
the absolute path to the root directory of the paths to be considered.
- patterns System.String[]
the absolute path to the root directory of the paths to be considered.
Returns
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 System.String
the absolute path to the root directory of the paths to be considered.
- patterns System.String[]
the absolute path to the root directory of the paths to be considered.
Returns
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 System.String
absolute file path to be assessed against the pattern.
Returns
System.Boolean
true
if the file should be ignored