public class MatlabCommandRunner extends Object
Constructor and Description |
---|
MatlabCommandRunner(MatlabActionParameters params) |
Modifier and Type | Method and Description |
---|---|
void |
addEnvironmentVariable(String key,
String value)
Adds an environment variable.
|
hudson.FilePath |
copyFileToTempFolder(String sourceFile,
String targetFile)
Copies a resource into the temporary folder.
|
protected hudson.FilePath |
createFileWithContent(String content)
Creates a file with the specified content in the temporary folder.
|
hudson.EnvVars |
getEnvVars() |
hudson.FilePath |
getTempFolder() |
protected hudson.FilePath |
prepareRunnerExecutable()
Copies platform specific runner file into the temporary folder.
|
void |
redirectStdOut(OutputStream out)
Redirects stdout.
|
void |
removeTempFolder() |
void |
runMatlabCommand(String command)
Spawns a process to run the specified command.
|
public MatlabCommandRunner(MatlabActionParameters params) throws IOException, InterruptedException
IOException
InterruptedException
public void runMatlabCommand(String command) throws IOException, InterruptedException, MatlabExecutionException
command
- The command to runIOException
InterruptedException
MatlabExecutionException
public void redirectStdOut(OutputStream out)
out
- the OutputStream to write topublic void addEnvironmentVariable(String key, String value)
key
- the environment variable namevalue
- the environment variable valuepublic hudson.EnvVars getEnvVars()
public hudson.FilePath copyFileToTempFolder(String sourceFile, String targetFile) throws IOException, InterruptedException
sourceFile
- the name of a resource the class loader can find.targetFile
- the name of the file to create in the temp folder.IOException
InterruptedException
public hudson.FilePath getTempFolder()
public void removeTempFolder() throws IOException, InterruptedException
IOException
InterruptedException
protected hudson.FilePath createFileWithContent(String content) throws IOException, InterruptedException
content
- string that represents the content of the file.IOException
InterruptedException
protected hudson.FilePath prepareRunnerExecutable() throws IOException, InterruptedException
IOException
InterruptedException
Copyright © 2016–2024. All rights reserved.