Class ProcessSupport.ScriptOwner

java.lang.Object
de.iip_ecosphere.platform.services.environment.ProcessSupport.ScriptOwner
Enclosing class:
ProcessSupport

public static class ProcessSupport.ScriptOwner extends Object
Holds the script context.
Author:
Holger Eichelberger, SSE
  • Field Details

    • initialized

      private boolean initialized
    • pythonFolder

      private File pythonFolder
    • tmpFolderName

      private String tmpFolderName
    • testFallbackPath

      private String testFallbackPath
    • zipFileName

      private String zipFileName
    • resultFile

      private String resultFile
    • processCustomizer

      private Consumer<ProcessBuilder> processCustomizer
  • Constructor Details

    • ScriptOwner

      public ScriptOwner(String tmpFolderName, String testFallbackPath, String zipFileName)
      Creates an instance.
      Parameters:
      tmpFolderName - the temp folder name where to copy the script/extract the ZIP to.
      testFallbackPath - the test fallback path in the local project taking precedence during testing
      zipFileName - the ZIP file name to read from classpath
    • ScriptOwner

      public ScriptOwner(String tmpFolderName, String testFallbackPath, String zipFileName, String resultFile)
      Creates an instance.
      Parameters:
      tmpFolderName - the temp folder name where to copy the script/extract the ZIP to.
      testFallbackPath - the test fallback path in the local project taking precedence during testing
      zipFileName - the ZIP file name to read from classpath
      resultFile - file to read result from, e.g., short lived processes, if null use standard in
  • Method Details

    • isInitialized

      public boolean isInitialized()
      Returns whether the holder/folder is initialized.
      Returns:
      whether it is initialized
    • setInitialized

      void setInitialized(boolean initialized)
      Defines whether the holder/folder is initialized.
      Parameters:
      initialized - whether it is initialized
    • getPythonFolder

      public File getPythonFolder()
      Returns the folder where the extracted script is located in.
      Returns:
      the folder
    • setPythonFolder

      void setPythonFolder(File pythonFolder)
      Changes the folder where the extracted script is located in.
      Parameters:
      pythonFolder - the folder
    • getTmpFolderName

      public String getTmpFolderName()
      Returns the temporary folder name to extract the scripts into.
      Returns:
      the temporary folder name
    • getTestFallbackPath

      public String getTestFallbackPath()
      Returns the fallback path to read the script during tests from the project folders.
      Returns:
      the fallback path
    • getZipFileName

      public String getZipFileName()
      Returns the ZIP file name containing the script.
      Returns:
      the ZIP file name as to be read as resource
    • getResultFile

      public String getResultFile()
      Returns the result file.
      Returns:
      the result file
    • withProcessCustomizer

      public ProcessSupport.ScriptOwner withProcessCustomizer(Consumer<ProcessBuilder> customizer)
      Adds an optional process customizer.
      Parameters:
      customizer - the customizer
      Returns:
      thi
    • getProcessCustomizer

      public Consumer<ProcessBuilder> getProcessCustomizer()
      Returns the optional process customizer.
      Returns:
      the customizer, may be null