Class ProcessSupport.ScriptOwner
- java.lang.Object
-
- de.iip_ecosphere.platform.services.environment.ProcessSupport.ScriptOwner
-
- Enclosing class:
- ProcessSupport
public static class ProcessSupport.ScriptOwner extends java.lang.ObjectHolds the script context.- Author:
- Holger Eichelberger, SSE
-
-
Field Summary
Fields Modifier and Type Field Description private booleaninitializedprivate java.util.function.Consumer<java.lang.ProcessBuilder>processCustomizerprivate java.io.FilepythonFolderprivate java.lang.StringresultFileprivate java.lang.StringtestFallbackPathprivate java.lang.StringtmpFolderNameprivate java.lang.StringzipFileName
-
Constructor Summary
Constructors Constructor Description ScriptOwner(java.lang.String tmpFolderName, java.lang.String testFallbackPath, java.lang.String zipFileName)Creates an instance.ScriptOwner(java.lang.String tmpFolderName, java.lang.String testFallbackPath, java.lang.String zipFileName, java.lang.String resultFile)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Consumer<java.lang.ProcessBuilder>getProcessCustomizer()Returns the optional process customizer.java.io.FilegetPythonFolder()Returns the folder where the extracted script is located in.java.lang.StringgetResultFile()Returns the result file.java.lang.StringgetTestFallbackPath()Returns the fallback path to read the script during tests from the project folders.java.lang.StringgetTmpFolderName()Returns the temporary folder name to extract the scripts into.java.lang.StringgetZipFileName()Returns the ZIP file name containing the script.booleanisInitialized()Returns whether the holder/folder is initialized.(package private) voidsetInitialized(boolean initialized)Defines whether the holder/folder is initialized.(package private) voidsetPythonFolder(java.io.File pythonFolder)Changes the folder where the extracted script is located in.ProcessSupport.ScriptOwnerwithProcessCustomizer(java.util.function.Consumer<java.lang.ProcessBuilder> customizer)Adds an optional process customizer.
-
-
-
Field Detail
-
initialized
private boolean initialized
-
pythonFolder
private java.io.File pythonFolder
-
tmpFolderName
private java.lang.String tmpFolderName
-
testFallbackPath
private java.lang.String testFallbackPath
-
zipFileName
private java.lang.String zipFileName
-
resultFile
private java.lang.String resultFile
-
processCustomizer
private java.util.function.Consumer<java.lang.ProcessBuilder> processCustomizer
-
-
Constructor Detail
-
ScriptOwner
public ScriptOwner(java.lang.String tmpFolderName, java.lang.String testFallbackPath, java.lang.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 testingzipFileName- the ZIP file name to read from classpath
-
ScriptOwner
public ScriptOwner(java.lang.String tmpFolderName, java.lang.String testFallbackPath, java.lang.String zipFileName, java.lang.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 testingzipFileName- the ZIP file name to read from classpathresultFile- file to read result from, e.g., short lived processes, ifnulluse standard in
-
-
Method Detail
-
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 java.io.File getPythonFolder()
Returns the folder where the extracted script is located in.- Returns:
- the folder
-
setPythonFolder
void setPythonFolder(java.io.File pythonFolder)
Changes the folder where the extracted script is located in.- Parameters:
pythonFolder- the folder
-
getTmpFolderName
public java.lang.String getTmpFolderName()
Returns the temporary folder name to extract the scripts into.- Returns:
- the temporary folder name
-
getTestFallbackPath
public java.lang.String getTestFallbackPath()
Returns the fallback path to read the script during tests from the project folders.- Returns:
- the fallback path
-
getZipFileName
public java.lang.String getZipFileName()
Returns the ZIP file name containing the script.- Returns:
- the ZIP file name as to be read as resource
-
getResultFile
public java.lang.String getResultFile()
Returns the result file.- Returns:
- the result file
-
withProcessCustomizer
public ProcessSupport.ScriptOwner withProcessCustomizer(java.util.function.Consumer<java.lang.ProcessBuilder> customizer)
Adds an optional process customizer.- Parameters:
customizer- the customizer- Returns:
- thi
-
getProcessCustomizer
public java.util.function.Consumer<java.lang.ProcessBuilder> getProcessCustomizer()
Returns the optional process customizer.- Returns:
- the customizer, may be null
-
-