Uses of Class
hudson.FilePath
Package
Description
Core object model that are bound to URLs via stapler, rooted at
Jenkins
.Listener interfaces for various events that occur inside the server.
Jenkins's interface with source code management systems.
Code related to agents.
Other miscellaneous utility code
-
Uses of FilePath in hudson
Modifier and TypeMethodDescriptionFilePath.absolutize()
Absolutizes thisFilePath
and returns the new one.The same asFilePath(FilePath,String)
but more OO.FilePath.createTempDir
(String prefix, String suffix) Creates a temporary directory inside the directory represented by 'this'FilePath.createTempFile
(String prefix, String suffix) Creates a temporary file in the directory that thisFilePath
object designates.FilePath.createTextTempFile
(String prefix, String suffix, String contents) Creates a temporary file in this directory and set the contents to the given text (encoded in the platform default encoding)FilePath.createTextTempFile
(String prefix, String suffix, String contents, boolean inThisDirectory) Creates a temporary file in this directory (or the system temporary directory) and set the contents to the given text (encoded in the platform default encoding)static FilePath
FilePath.getHomeDirectory
(hudson.remoting.VirtualChannel ch) Gets theFilePath
representation of the "~" directory (User's home directory in the Unix sense) of the given channel.FilePath.getParent()
Gets the parent file.FilePath[]
List up files in this directory that matches the given Ant-style filter.FilePath[]
List up files in this directory that matches the given Ant-style filter.FilePath[]
List up files in this directory that matches the given Ant-style filter.Launcher.ProcStarter.pwd()
Short forgetParent().child(rel)
.FilePath.withSuffix
(String suffix) Returns aFilePath
by adding the given suffix to this path name.Modifier and TypeMethodDescriptionFilePath.list()
List up files and directories in this directory.FilePath.list
(FilePath verificationRoot, OpenOption... openOptions) List up files and directories in this directory.FilePath.list
(FileFilter filter) List up files in this directory, just likeFile.listFiles(FileFilter)
.FilePath.listDirectories()
List up subdirectories.Modifier and TypeMethodDescriptionboolean
FilePath.containsSymlink
(FilePath verificationRoot, OpenOption... openOptions) void
Convenience method to callcopyTo(FilePath)
.int
FilePath.copyRecursiveTo
(FilePath target) Copies the contents of this directory recursively into the specified target directory.int
FilePath.copyRecursiveTo
(DirScanner scanner, FilePath target, String description) Copies files according to a specified scanner to a target node.int
FilePath.copyRecursiveTo
(DirScanner scanner, FilePath target, String description, FilePath.TarCompression compression) Copies files according to a specified scanner to a target node.int
FilePath.copyRecursiveTo
(String fileMask, FilePath target) Copies the files that match the given file mask to the specified target node.int
FilePath.copyRecursiveTo
(String fileMask, String excludes, FilePath target) Copies the files that match the given file mask to the specified target node.void
Copies this file to the specified target.void
FilePath.copyToWithPermission
(FilePath target) Copies this file to the specified target, with file permissions and other meta attributes intact.void
FileSystemProvisioner.Default.discardWorkspace
(AbstractProject<?, ?> project, FilePath ws) abstract void
FileSystemProvisioner.discardWorkspace
(AbstractProject<?, ?> project, FilePath ws) Deprecated.boolean
FilePath.hasSymlink
(FilePath verificationRoot, OpenOption... openOptions) Launcher.DecoratedLauncher.launch
(String[] cmd, boolean[] mask, String[] env, InputStream in, OutputStream out, FilePath workDir) Launcher.DecoratedLauncher.launch
(String[] cmd, String[] env, InputStream in, OutputStream out, FilePath workDir) Launcher.launch
(String[] cmd, boolean[] mask, String[] env, InputStream in, OutputStream out, FilePath workDir) Deprecated.final Proc
Launcher.launch
(String[] cmd, boolean[] mask, String[] env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternfinal Proc
Launcher.launch
(String[] cmd, boolean[] mask, Map<String, String> env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternLauncher.launch
(String[] cmd, String[] env, InputStream in, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternfinal Proc
Launcher.launch
(String[] cmd, String[] env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternfinal Proc
Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternfinal Proc
Launcher.launch
(String cmd, String[] env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternfinal Proc
Deprecated.as of 1.311 UseLauncher.launch()
and its associated builder patternhudson.remoting.Channel
Launcher.DecoratedLauncher.launchChannel
(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) hudson.remoting.Channel
Launcher.DummyLauncher.launchChannel
(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) abstract hudson.remoting.Channel
Launcher.launchChannel
(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) Launches a specified process and connects its input/output to aChannel
, then return it.hudson.remoting.Channel
Launcher.LocalLauncher.launchChannel
(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) hudson.remoting.Channel
Launcher.RemoteLauncher.launchChannel
(String[] cmd, OutputStream err, FilePath _workDir, Map<String, String> envOverrides) FilePath.list
(FilePath verificationRoot, OpenOption... openOptions) List up files and directories in this directory.protected final void
Launcher.maskedPrintCommandLine
(String[] cmd, boolean[] mask, FilePath workDir) protected final void
Launcher.maskedPrintCommandLine
(List<String> cmd, boolean[] mask, FilePath workDir) Prints out the command line to the listener with some portions masked to prevent sensitive information from being recorded on the listener.void
FilePath.moveAllChildrenTo
(FilePath target) Moves all the contents of this directory into the specified directory, then delete this directory itself.void
FileSystemProvisioner.Default.prepareWorkspace
(AbstractBuild<?, ?> build, FilePath ws, TaskListener listener) abstract void
FileSystemProvisioner.prepareWorkspace
(AbstractBuild<?, ?> build, FilePath ws, TaskListener listener) Deprecated.protected final void
Launcher.printCommandLine
(String[] cmd, FilePath workDir) Prints out the command line to the listener so that users know what we are doing.Sets the current directory.FilePath.read
(FilePath rootPath, OpenOption... openOptions) void
Rename this file/directory to the target filepath.abstract void
WorkspaceSnapshot.restoreTo
(AbstractBuild<?, ?> owner, FilePath dst, TaskListener listener) Deprecated.Restores the snapshot to the given file system location.FileSystemProvisioner.Default.snapshot
(AbstractBuild<?, ?> build, FilePath ws, String glob, TaskListener listener) abstract WorkspaceSnapshot
FileSystemProvisioner.snapshot
(AbstractBuild<?, ?> build, FilePath ws, String glob, TaskListener listener) Deprecated.void
FilePath.untar
(FilePath target, FilePath.TarCompression compression) When thisFilePath
represents a tar file, extracts that tar file.void
When thisFilePath
represents a zip file, extracts that zip file.static FormValidation
FilePath.validateFileMask
(FilePath path, String value) Short forvalidateFileMask(path, value, true)
static FormValidation
FilePath.validateFileMask
(FilePath path, String value, boolean caseSensitive) Shortcut forvalidateFileMask(String,boolean,boolean)
witherrorIfNotExist
true, as the left-hand side can be null.void
-
Uses of FilePath in hudson.logging
Modifier and TypeMethodDescriptionvoid
LogRecorder.ComputerLogInitializer.preOnline
(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) -
Uses of FilePath in hudson.model
Modifier and TypeMethodDescriptionNode.createPath
(String absolutePath) Gets theFilePath
on this node.Executor.getCurrentWorkspace()
If current executable isAbstractBuild
, return the workspace that this executor is using, or null if the build hasn't gotten to that point yet.final FilePath
AbstractBuild.getModuleRoot()
Returns the root directory of the checked-out module.AbstractProject.getModuleRoot()
Deprecated.as of 1.319 SeeAbstractProject.getWorkspace()
for a migration strategy.FilePath[]
AbstractBuild.getModuleRoots()
Returns the root directories of all checked-out modules.FilePath[]
AbstractProject.getModuleRoots()
Deprecated.as of 1.319 SeeAbstractProject.getWorkspace()
for a migration strategy.abstract FilePath
Node.getRootPath()
Gets the root directory of this node.Slave.getRootPath()
final FilePath
AbstractProject.getSomeWorkspace()
Gets a workspace for some build of this project.final FilePath
AbstractBuild.getWorkspace()
Gets the directory where this build is being built.final FilePath
AbstractProject.getWorkspace()
Deprecated.as of 1.319 To support concurrent builds of the same project, this method is moved toAbstractBuild
.abstract FilePath
WorkspaceBrowser.getWorkspace
(Job job) Provide access to job's workspaceabstract FilePath
Node.getWorkspaceFor
(TopLevelItem item) Returns a "workspace" directory for the givenTopLevelItem
.Slave.getWorkspaceFor
(TopLevelItem item) Slave.getWorkspaceRoot()
Root directory on this agent where all the job workspaces are laid out.Modifier and TypeMethodDescriptionvoid
WorkspaceListener.beforeUse
(AbstractBuild b, FilePath workspace, BuildListener listener) Called before a build uses a workspace.void
DirectoryBrowserSupport.serveFile
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, FilePath root, String icon, boolean serveDirIndex) Deprecated.as of 1.297 Instead of calling this method explicitly, just return theDirectoryBrowserSupport
object from thedoXYZ
method and let Stapler generate a response for you.protected void
AbstractBuild.setWorkspace
(FilePath ws) Normally, a workspace is assigned byRun.RunExecution
, but this lets you set the workspace in caseAbstractBuild
is created without a build.ModifierConstructorDescriptionDirectoryBrowserSupport
(ModelObject owner, FilePath base, String title, String icon, boolean serveDirIndex) -
Uses of FilePath in hudson.model.listeners
Modifier and TypeMethodDescriptionvoid
SCMListener.onCheckout
(Run<?, ?> build, SCM scm, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState pollingBaseline) Should be called immediately afterSCM.checkout(Run, Launcher, FilePath, TaskListener, File, SCMRevisionState)
is called. -
Uses of FilePath in hudson.scm
Modifier and TypeMethodDescriptionSCM.getModuleRoot
(FilePath workspace) Deprecated.since 1.382 Use/overrideSCM.getModuleRoot(FilePath, AbstractBuild)
instead.SCM.getModuleRoot
(FilePath workspace, AbstractBuild build) Gets the top directory of the checked out module.FilePath[]
SCM.getModuleRoots
(FilePath workspace) Deprecated.as of 1.382.FilePath[]
SCM.getModuleRoots
(FilePath workspace, AbstractBuild build) Gets the top directories of all the checked out modules.Modifier and TypeMethodDescriptionNullSCM.calcRevisionsFromBuild
(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) SCM.calcRevisionsFromBuild
(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Calculates theSCMRevisionState
that represents the state of the workspace of the given build.void
NullSCM.checkout
(Run<?, ?> build, Launcher launcher, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState baseline) boolean
SCM.checkout
(AbstractBuild<?, ?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) Deprecated.void
SCM.checkout
(Run<?, ?> build, Launcher launcher, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState baseline) Obtains a fresh workspace of the module(s) into the specified directory of the specified machine.NullSCM.compareRemoteRevisionWith
(Job<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) protected PollingResult
SCM.compareRemoteRevisionWith
(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) Deprecated.SCM.compareRemoteRevisionWith
(Job<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) Compares the current state of the remote repository against the given baselineSCMRevisionState
.SCM.getModuleRoot
(FilePath workspace) Deprecated.since 1.382 Use/overrideSCM.getModuleRoot(FilePath, AbstractBuild)
instead.SCM.getModuleRoot
(FilePath workspace, AbstractBuild build) Gets the top directory of the checked out module.FilePath[]
SCM.getModuleRoots
(FilePath workspace) Deprecated.as of 1.382.FilePath[]
SCM.getModuleRoots
(FilePath workspace, AbstractBuild build) Gets the top directories of all the checked out modules.final PollingResult
SCM.poll
(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) Convenience method for the caller to handle the backward compatibility between pre 1.345 SCMs.boolean
SCM.pollChanges
(AbstractProject<?, ?> project, Launcher launcher, FilePath workspace, TaskListener listener) Deprecated.as of 1.345 OverrideSCM.calcRevisionsFromBuild(AbstractBuild, Launcher, TaskListener)
andSCM.compareRemoteRevisionWith(AbstractProject, Launcher, FilePath, TaskListener, SCMRevisionState)
for implementation.void
SCM.postCheckout
(AbstractBuild<?, ?> build, Launcher launcher, FilePath workspace, BuildListener listener) Deprecated.void
SCM.postCheckout
(Run<?, ?> build, Launcher launcher, FilePath workspace, TaskListener listener) Get a chance to do operations after the workspace i checked out and the changelog is written.boolean
SCM.processWorkspaceBeforeDeletion
(AbstractProject<?, ?> project, FilePath workspace, Node node) Deprecated.boolean
SCM.processWorkspaceBeforeDeletion
(Job<?, ?> project, FilePath workspace, Node node) Called before a workspace is deleted on the given node, to provide SCM an opportunity to perform clean up. -
Uses of FilePath in hudson.slaves
Modifier and TypeFieldDescriptionfinal FilePath
WorkspaceList.Entry.path
final FilePath
WorkspaceList.Lease.path
Modifier and TypeMethodDescriptionstatic FilePath
Locates a conventional temporary directory to be associated with a workspace.Modifier and TypeMethodDescriptionAcquires the given workspace.Allocates a workspace by adding some variation to the given base to make it unique.static WorkspaceList.Lease
WorkspaceList.Lease.createDummyLease
(FilePath p) Creates a dummyWorkspaceList.Lease
object that does no-op in the release.static WorkspaceList.Lease
WorkspaceList.Lease.createLinkedDummyLease
(FilePath p, WorkspaceList.Lease parent) Creates aWorkspaceList.Lease
object that points to the specified path, but the lock is controlled by the given parent lease object.static hudson.remoting.Channel
Channels.newJVM
(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String, String> systemProperties) Deprecated.removed without replacementstatic hudson.remoting.Channel
Channels.newJVM
(String displayName, TaskListener listener, JVMBuilder vmb, FilePath workDir, ClasspathBuilder classpath) Deprecated.removed without replacementvoid
ChannelPinger.preOnline
(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) void
ComputerListener.preOnline
(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) Called before aComputer
is marked online.Just record that this workspace is being used, without paying any attention to the synchronization support.static FilePath
Locates a conventional temporary directory to be associated with a workspace. -
Uses of FilePath in hudson.tasks
Modifier and TypeMethodDescriptionCommandInterpreter.createScriptFile
(FilePath dir) Creates a script file in a temporary name in the specified directory.Modifier and TypeMethodDescriptionString[]
BatchFile.buildCommandLine
(FilePath script) abstract String[]
CommandInterpreter.buildCommandLine
(FilePath script) String[]
Shell.buildCommandLine
(FilePath script) CommandInterpreter.createScriptFile
(FilePath dir) Creates a script file in a temporary name in the specified directory.void
ArtifactArchiver.perform
(Run<?, ?> build, FilePath ws, EnvVars environment, Launcher launcher, TaskListener listener) void
Fingerprinter.perform
(Run<?, ?> build, FilePath workspace, EnvVars environment, Launcher launcher, TaskListener listener) -
Uses of FilePath in hudson.tools
Modifier and TypeMethodDescriptionprotected FilePath
DownloadFromUrlInstaller.findPullUpDirectory
(FilePath root) Often an archive contains an extra top-level directory that's unnecessary when extracted on the disk into the expected location.AbstractCommandInstaller.performInstallation
(ToolInstallation tool, Node node, TaskListener log) DownloadFromUrlInstaller.performInstallation
(ToolInstallation tool, Node node, TaskListener log) abstract FilePath
ToolInstaller.performInstallation
(ToolInstallation tool, Node node, TaskListener log) Ensure that the configured tool is really installed.ZipExtractionInstaller.performInstallation
(ToolInstallation tool, Node node, TaskListener log) protected final FilePath
ToolInstaller.preferredLocation
(ToolInstallation tool, Node node) Convenience method to find a location to install a tool.Modifier and TypeMethodDescriptionprotected FilePath
DownloadFromUrlInstaller.findPullUpDirectory
(FilePath root) Often an archive contains an extra top-level directory that's unnecessary when extracted on the disk into the expected location.abstract String[]
AbstractCommandInstaller.getCommandCall
(FilePath script) Retrieves a call for remote script caller.String[]
BatchCommandInstaller.getCommandCall
(FilePath script) String[]
CommandInstaller.getCommandCall
(FilePath script) protected boolean
DownloadFromUrlInstaller.isUpToDate
(FilePath expectedLocation, DownloadFromUrlInstaller.Installable i) Checks if the specified expected location already contains the installed version of the tool. -
Uses of FilePath in hudson.util
Modifier and TypeMethodDescriptionprotected FilePath
FormFieldValidator.WorkspaceFileMask.getBaseDirectory
(AbstractProject<?, ?> p) Deprecated.The base directory from which the path name is resolved.protected FilePath
FormFieldValidator.WorkspaceFilePath.getBaseDirectory
(AbstractProject<?, ?> p) Deprecated.The base directory from which the path name is resolved.static FilePath
RemotingDiagnostics.getHeapDump
(hudson.remoting.VirtualChannel channel) Obtains the heap dump in an HPROF file.RemotingDiagnostics.HeapDump.obtain()
Modifier and TypeMethodDescriptionAdds a single directory or a jar file.Adds all the files that matches the given glob in the directory.Sets the current directory for the new JVM. -
Uses of FilePath in jenkins.install
Modifier and TypeMethodDescriptionSetupWizard.getInitialAdminApiTokenFile()
Gets the file used to store the initial admin API Token, in case the system propertySetupWizard.ADMIN_INITIAL_API_TOKEN
is set to "true" (and only in this case).SetupWizard.getInitialAdminPasswordFile()
Gets the file used to store the initial admin password -
Uses of FilePath in jenkins.model
Modifier and TypeMethodDescriptionJenkins.createPath
(String absolutePath) Jenkins.getRootPath()
Jenkins.getWorkspaceFor
(TopLevelItem item) Modifier and TypeMethodDescriptionabstract void
ArtifactManager.archive
(FilePath workspace, Launcher launcher, BuildListener listener, Map<String, String> artifacts) Archive all configured artifacts from a build.void
StandardArtifactManager.archive
(FilePath workspace, Launcher launcher, BuildListener listener, Map<String, String> artifacts) -
Uses of FilePath in jenkins.mvn
Modifier and TypeMethodDescriptionstatic FilePath
GlobalSettingsProvider.getSettingsFilePath
(GlobalSettingsProvider settings, AbstractBuild<?, ?> build, TaskListener listener) Convenience method handling allnull
checks.static FilePath
SettingsProvider.getSettingsFilePath
(SettingsProvider settings, AbstractBuild<?, ?> build, TaskListener listener) Convenience method handling allnull
checks.DefaultGlobalSettingsProvider.supplySettings
(AbstractBuild<?, ?> project, TaskListener listener) DefaultSettingsProvider.supplySettings
(AbstractBuild<?, ?> project, TaskListener listener) FilePathGlobalSettingsProvider.supplySettings
(AbstractBuild<?, ?> build, TaskListener listener) FilePathSettingsProvider.supplySettings
(AbstractBuild<?, ?> build, TaskListener listener) abstract FilePath
GlobalSettingsProvider.supplySettings
(AbstractBuild<?, ?> build, TaskListener listener) configure maven launcher argument list with adequate settings pathabstract FilePath
SettingsProvider.supplySettings
(AbstractBuild<?, ?> build, TaskListener listener) Configure maven launcher argument list with adequate settings path. -
Uses of FilePath in jenkins.slaves
Modifier and TypeMethodDescriptionabstract FilePath
WorkspaceLocator.locate
(TopLevelItem item, Node node) Allows extensions to customize the workspace path.Modifier and TypeMethodDescriptionvoid
StandardOutputSwapper.preOnline
(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) -
Uses of FilePath in jenkins.tasks
Modifier and TypeMethodDescriptiondefault void
SimpleBuildStep.perform
(Run<?, ?> run, FilePath workspace, EnvVars env, Launcher launcher, TaskListener listener) Run this step.default void
SimpleBuildStep.perform
(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) Deprecated.void
SimpleBuildWrapper.setUp
(SimpleBuildWrapper.Context context, Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener, EnvVars initialEnvironment) Called when a segment of a build is started that is to be enhanced with this wrapper.void
SimpleBuildWrapper.Disposer.tearDown
(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Attempt to clean up anything that was done in the initial setup. -
Uses of FilePath in jenkins.util
Modifier and TypeMethodDescriptionstatic VirtualFile
VirtualFile.forFilePath
(FilePath f) Creates a virtual file wrapper for a remotable file.void
SystemProperties.AgentCopier.preOnline
(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener)
Launcher.launch()
and its associated builder pattern