Class IgnoreStrategy

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.IgnoreStrategy
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
DockerIgnoreStrategy, GitIgnoreStrategy, GlobIgnoreStrategy

@Generated(value="jsii-pacmak/1.102.0 (build e354887)", date="2024-08-23T05:56:10.102Z") @Stability(Stable) public abstract class IgnoreStrategy extends software.amazon.jsii.JsiiObject
Represents file path ignoring behavior.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.*;
 IgnoreStrategy ignoreStrategy = IgnoreStrategy.fromCopyOptions(CopyOptions.builder()
         .exclude(List.of("exclude"))
         .follow(SymlinkFollowMode.NEVER)
         .ignoreMode(IgnoreMode.GLOB)
         .build(), "absoluteRootPath");
 
  • Constructor Details

    • IgnoreStrategy

      protected IgnoreStrategy(software.amazon.jsii.JsiiObjectRef objRef)
    • IgnoreStrategy

      protected IgnoreStrategy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • IgnoreStrategy

      @Stability(Stable) protected IgnoreStrategy()
  • Method Details

    • docker

      @Stability(Stable) @NotNull public static DockerIgnoreStrategy docker(@NotNull String absoluteRootPath, @NotNull List<String> patterns)
      Ignores file paths based on the .dockerignore specification.

      Parameters:
      absoluteRootPath - the absolute path to the root directory of the paths to be considered. This parameter is required.
      patterns - This parameter is required.
      Returns:
      DockerIgnorePattern associated with the given patterns.
    • fromCopyOptions

      @Stability(Stable) @NotNull public static IgnoreStrategy fromCopyOptions(@NotNull CopyOptions options, @NotNull String absoluteRootPath)
      Creates an IgnoreStrategy based on the ignoreMode and exclude in a CopyOptions.

      Parameters:
      options - the CopyOptions to create the IgnoreStrategy from. This parameter is required.
      absoluteRootPath - the absolute path to the root directory of the paths to be considered. This parameter is required.
      Returns:
      IgnoreStrategy based on the CopyOptions
    • git

      @Stability(Stable) @NotNull public static GitIgnoreStrategy git(@NotNull String absoluteRootPath, @NotNull List<String> patterns)
      Ignores file paths based on the .gitignore specification.

      Parameters:
      absoluteRootPath - the absolute path to the root directory of the paths to be considered. This parameter is required.
      patterns - This parameter is required.
      Returns:
      GitIgnorePattern associated with the given patterns.
    • glob

      @Stability(Stable) @NotNull public static GlobIgnoreStrategy glob(@NotNull String absoluteRootPath, @NotNull List<String> patterns)
      Ignores file paths based on simple glob patterns.

      Parameters:
      absoluteRootPath - the absolute path to the root directory of the paths to be considered. This parameter is required.
      patterns - This parameter is required.
      Returns:
      GlobIgnorePattern associated with the given patterns.
    • add

      @Stability(Stable) public abstract void add(@NotNull String pattern)
      Adds another pattern.

      Parameters:
      pattern - This parameter is required.
    • ignores

      @Stability(Stable) @NotNull public abstract Boolean ignores(@NotNull String absoluteFilePath)
      Determines whether a given file path should be ignored or not.

      Parameters:
      absoluteFilePath - absolute file path to be assessed against the pattern. This parameter is required.
      Returns:
      true if the file should be ignored