Class S3FindFilesStep.Execution

java.lang.Object
org.jenkinsci.plugins.workflow.steps.StepExecution
org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution<FileWrapper[]>
de.taimos.pipeline.aws.S3FindFilesStep.Execution
All Implemented Interfaces:
Serializable
Enclosing class:
S3FindFilesStep

public static class S3FindFilesStep.Execution extends org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution<FileWrapper[]>
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Execution(S3FindFilesStep step, org.jenkinsci.plugins.workflow.steps.StepContext context)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    This computes the string that will be used to construct a PathMatcher that will attempt to match the S3 keys.
    static String
    This converts a Path to a string that represents the AWS path.
    createFileWrapperFromFile(int pathComponentCount, Path javaPath, com.amazonaws.services.s3.model.S3ObjectSummary entry)
    This creates a new FileWrapper instance based on the S3ObjectSummary information.
    createFileWrapperFromFolder(int pathComponentCount, Path javaPath)
    This creates a new FileWrapper instance for the folder.
    run()
     

    Methods inherited from class org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution

    blocksRestart, getStatus, onResume, start, stop

    Methods inherited from class org.jenkinsci.plugins.workflow.steps.StepExecution

    applyAll, applyAll, getContext, getStatusBounded

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Execution

      public Execution(S3FindFilesStep step, org.jenkinsci.plugins.workflow.steps.StepContext context)
  • Method Details

    • run

      public FileWrapper[] run() throws Exception
      Specified by:
      run in class org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution<FileWrapper[]>
      Throws:
      Exception
    • computeMatcherString

      public static String computeMatcherString(String path, String glob)
      This computes the string that will be used to construct a PathMatcher that will attempt to match the S3 keys.
      Parameters:
      path - The step's `path` parameter.
      glob - The step's `glob` parameter.
      Returns:
      A string that can be used to construct a PathMatcher.
    • createFileWrapperFromFile

      public static FileWrapper createFileWrapperFromFile(int pathComponentCount, Path javaPath, com.amazonaws.services.s3.model.S3ObjectSummary entry)
      This creates a new FileWrapper instance based on the S3ObjectSummary information.
      Parameters:
      pathComponentCount - The root path component count.
      javaPath - The Path instance for the file.
      entry - The S3ObjectSummary for the file.
      Returns:
      A new FileWrapper instance.
    • createFileWrapperFromFolder

      public static FileWrapper createFileWrapperFromFolder(int pathComponentCount, Path javaPath)
      This creates a new FileWrapper instance for the folder.
      Parameters:
      pathComponentCount - The root path component count.
      javaPath - The Path instance for the folder.
      Returns:
      A new FileWrapper instance.
    • convertPathToAwsFormat

      public static String convertPathToAwsFormat(Path javaPath)
      This converts a Path to a string that represents the AWS path. Since the Path instance will be coming from a FileSystem (in fact, the OS's "default FileSystem"), we can't trust that the separator will always be "/", which is what AWS wants. So, this method will convert all of the default separators to "/".
      Parameters:
      javaPath - The Path instance.
      Returns:
      A string representing the path, which AWS can use.