Class FileMonitoringTask
java.lang.Object
hudson.model.AbstractDescribableImpl<DurableTask>
org.jenkinsci.plugins.durabletask.DurableTask
org.jenkinsci.plugins.durabletask.FileMonitoringTask
- All Implemented Interfaces:
- ExtensionPoint,- Describable<DurableTask>
- Direct Known Subclasses:
- BourneShellScript,- PowershellScript,- WindowsBatchScript
A task which forks some external command and then waits for log and status files to be updated/created.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classTails a log file and watches for an exit status file.Nested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidRequests that a specified charset be used to transcode process output.final voidRequests that the node’s system charset be used to transcode process output.doLaunch(FilePath workspace, Launcher launcher, TaskListener listener, EnvVars envVars) Should start a process which sends output to log file in the workspace and finally writes its exit code to result file.JENKINS-40734: blocks the substitutions ofEnvVars.overrideExpandingAll(java.util.Map<java.lang.String, java.lang.String>)done byLauncher.protected static AgentInfogetAgentInfo(FilePath nodeRoot) protected static FilePathgetNodeRoot(FilePath workspace) final Controllerlaunch(EnvVars env, FilePath workspace, Launcher launcher, TaskListener listener) Launches a durable task.launchWithCookie(FilePath workspace, Launcher launcher, TaskListener listener, EnvVars envVars, String cookieVariable, String cookieValue) protected static FilePathrequestBinary(FilePath nodeRoot, AgentInfo agentInfo, FilePath ws, FileMonitoringTask.FileMonitoringController c) Returns path of binary on agent.protected static FilePathReturns path of binary on agent.Methods inherited from class org.jenkinsci.plugins.durabletask.DurableTaskcaptureOutput, getDescriptor
- 
Field Details- 
COOKIE- See Also:
 
- 
BINARY_RESOURCE_PREFIX- See Also:
 
 
- 
- 
Constructor Details- 
FileMonitoringTaskpublic FileMonitoringTask()
 
- 
- 
Method Details- 
launchpublic final Controller launch(EnvVars env, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException Description copied from class:DurableTaskLaunches a durable task.- Specified by:
- launchin class- DurableTask
- Parameters:
- env- basic environment variables to use during launch
- workspace- the workspace to use
- launcher- a way to start processes
- listener- log output for the build
- Returns:
- a way to check up on the task’s subsequent status
- Throws:
- IOException
- InterruptedException
 
- 
launchWithCookieprotected FileMonitoringTask.FileMonitoringController launchWithCookie(FilePath workspace, Launcher launcher, TaskListener listener, EnvVars envVars, String cookieVariable, String cookieValue) throws IOException, InterruptedException - Throws:
- IOException
- InterruptedException
 
- 
charsetDescription copied from class:DurableTaskRequests that a specified charset be used to transcode process output. The encoding ofController.writeLog(hudson.FilePath, java.io.OutputStream)andController.getOutput(hudson.FilePath, hudson.Launcher)is then presumed to be UTF-8. If not called, no translation is performed.- Overrides:
- charsetin class- DurableTask
- Parameters:
- cs- the character set in which process output is expected to be
 
- 
defaultCharsetpublic final void defaultCharset()Description copied from class:DurableTaskRequests that the node’s system charset be used to transcode process output. The encoding ofController.writeLog(hudson.FilePath, java.io.OutputStream)andController.getOutput(hudson.FilePath, hudson.Launcher)is then presumed to be UTF-8. If not called, no translation is performed.- Overrides:
- defaultCharsetin class- DurableTask
 
- 
doLaunchprotected FileMonitoringTask.FileMonitoringController doLaunch(FilePath workspace, Launcher launcher, TaskListener listener, EnvVars envVars) throws IOException, InterruptedException Should start a process which sends output to log file in the workspace and finally writes its exit code to result file.- Parameters:
- workspace- the workspace to use
- launcher- a way to launch processes
- listener- build console log
- envVars- recommended environment for the subprocess
- Returns:
- a specialized controller
- Throws:
- IOException
- InterruptedException
 
- 
escapeJENKINS-40734: blocks the substitutions ofEnvVars.overrideExpandingAll(java.util.Map<java.lang.String, java.lang.String>)done byLauncher.
- 
getNodeRoot- Throws:
- IOException
 
- 
getAgentInfo- Throws:
- IOException
- InterruptedException
 
- 
requestBinary@CheckForNull protected static FilePath requestBinary(FilePath ws, FileMonitoringTask.FileMonitoringController c) throws IOException, InterruptedException Returns path of binary on agent. Copies binary to agent if it does not exist- Throws:
- IOException
- InterruptedException
 
- 
requestBinary@CheckForNull protected static FilePath requestBinary(FilePath nodeRoot, AgentInfo agentInfo, FilePath ws, FileMonitoringTask.FileMonitoringController c) throws IOException, InterruptedException Returns path of binary on agent. Copies binary to agent if it does not exist- Throws:
- IOException
- InterruptedException
 
 
-