Uses of Class
hudson.FilePath
Packages that use 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 thisFilePathand 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 thisFilePathobject 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 FilePathFilePath.getHomeDirectory(hudson.remoting.VirtualChannel ch) Gets theFilePathrepresentation 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 aFilePathby 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 TypeMethodDescriptionbooleanFilePath.containsSymlink(FilePath verificationRoot, OpenOption... openOptions) voidConvenience method to callcopyTo(FilePath).intFilePath.copyRecursiveTo(FilePath target) Copies the contents of this directory recursively into the specified target directory.intFilePath.copyRecursiveTo(DirScanner scanner, FilePath target, String description) Copies files according to a specified scanner to a target node.intFilePath.copyRecursiveTo(DirScanner scanner, FilePath target, String description, FilePath.TarCompression compression) Copies files according to a specified scanner to a target node.intFilePath.copyRecursiveTo(String fileMask, FilePath target) Copies the files that match the given file mask to the specified target node.intFilePath.copyRecursiveTo(String fileMask, String excludes, FilePath target) Copies the files that match the given file mask to the specified target node.voidCopies this file to the specified target.voidFilePath.copyToWithPermission(FilePath target) Copies this file to the specified target, with file permissions and other meta attributes intact.voidFileSystemProvisioner.Default.discardWorkspace(AbstractProject<?, ?> project, FilePath ws) abstract voidFileSystemProvisioner.discardWorkspace(AbstractProject<?, ?> project, FilePath ws) Deprecated.booleanFilePath.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 ProcLauncher.launch(String[] cmd, boolean[] mask, String[] env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()and its associated builder patternfinal ProcLauncher.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 ProcLauncher.launch(String[] cmd, String[] env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()and its associated builder patternfinal ProcDeprecated.as of 1.311 UseLauncher.launch()and its associated builder patternfinal ProcLauncher.launch(String cmd, String[] env, OutputStream out, FilePath workDir) Deprecated.as of 1.311 UseLauncher.launch()and its associated builder patternfinal ProcDeprecated.as of 1.311 UseLauncher.launch()and its associated builder patternhudson.remoting.ChannelLauncher.DecoratedLauncher.launchChannel(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) hudson.remoting.ChannelLauncher.DummyLauncher.launchChannel(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) abstract hudson.remoting.ChannelLauncher.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.ChannelLauncher.LocalLauncher.launchChannel(String[] cmd, OutputStream out, FilePath workDir, Map<String, String> envVars) hudson.remoting.ChannelLauncher.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 voidLauncher.maskedPrintCommandLine(String[] cmd, boolean[] mask, FilePath workDir) protected final voidLauncher.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.voidFilePath.moveAllChildrenTo(FilePath target) Moves all the contents of this directory into the specified directory, then delete this directory itself.voidFileSystemProvisioner.Default.prepareWorkspace(AbstractBuild<?, ?> build, FilePath ws, TaskListener listener) abstract voidFileSystemProvisioner.prepareWorkspace(AbstractBuild<?, ?> build, FilePath ws, TaskListener listener) Deprecated.protected final voidLauncher.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) voidRename this file/directory to the target filepath.abstract voidWorkspaceSnapshot.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 WorkspaceSnapshotFileSystemProvisioner.snapshot(AbstractBuild<?, ?> build, FilePath ws, String glob, TaskListener listener) Deprecated.voidFilePath.untar(FilePath target, FilePath.TarCompression compression) When thisFilePathrepresents a tar file, extracts that tar file.voidWhen thisFilePathrepresents a zip file, extracts that zip file.static FormValidationFilePath.validateFileMask(FilePath path, String value) Short forvalidateFileMask(path, value, true)static FormValidationFilePath.validateFileMask(FilePath path, String value, boolean caseSensitive) Shortcut forvalidateFileMask(String,boolean,boolean)witherrorIfNotExisttrue, as the left-hand side can be null.void -
Uses of FilePath in hudson.logging
Methods in hudson.logging with parameters of type FilePathModifier and TypeMethodDescriptionvoidLogRecorder.ComputerLogInitializer.preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) -
Uses of FilePath in hudson.model
Methods in hudson.model that return FilePathModifier and TypeMethodDescriptionNode.createPath(String absolutePath) Gets theFilePathon 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 FilePathAbstractBuild.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 FilePathNode.getRootPath()Gets the root directory of this node.Slave.getRootPath()final FilePathAbstractProject.getSomeWorkspace()Gets a workspace for some build of this project.final FilePathAbstractBuild.getWorkspace()Gets the directory where this build is being built.final FilePathAbstractProject.getWorkspace()Deprecated.as of 1.319 To support concurrent builds of the same project, this method is moved toAbstractBuild.abstract FilePathWorkspaceBrowser.getWorkspace(Job job) Provide access to job's workspaceabstract FilePathNode.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.Methods in hudson.model with parameters of type FilePathModifier and TypeMethodDescriptionvoidWorkspaceListener.beforeUse(AbstractBuild b, FilePath workspace, BuildListener listener) Called before a build uses a workspace.voidDirectoryBrowserSupport.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 theDirectoryBrowserSupportobject from thedoXYZmethod and let Stapler generate a response for you.protected voidAbstractBuild.setWorkspace(FilePath ws) Normally, a workspace is assigned byRun.RunExecution, but this lets you set the workspace in caseAbstractBuildis created without a build.Constructors in hudson.model with parameters of type FilePathModifierConstructorDescriptionDirectoryBrowserSupport(ModelObject owner, FilePath base, String title, String icon, boolean serveDirIndex) -
Uses of FilePath in hudson.model.listeners
Methods in hudson.model.listeners with parameters of type FilePathModifier and TypeMethodDescriptionvoidSCMListener.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
Methods in hudson.scm that return FilePathModifier 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.Methods in hudson.scm with parameters of type FilePathModifier and TypeMethodDescriptionNullSCM.calcRevisionsFromBuild(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) SCM.calcRevisionsFromBuild(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) Calculates theSCMRevisionStatethat represents the state of the workspace of the given build.voidNullSCM.checkout(Run<?, ?> build, Launcher launcher, FilePath workspace, TaskListener listener, File changelogFile, SCMRevisionState baseline) booleanSCM.checkout(AbstractBuild<?, ?> build, Launcher launcher, FilePath workspace, BuildListener listener, File changelogFile) Deprecated.voidSCM.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 PollingResultSCM.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 PollingResultSCM.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.booleanSCM.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.voidSCM.postCheckout(AbstractBuild<?, ?> build, Launcher launcher, FilePath workspace, BuildListener listener) Deprecated.voidSCM.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.booleanSCM.processWorkspaceBeforeDeletion(AbstractProject<?, ?> project, FilePath workspace, Node node) Deprecated.booleanSCM.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
Fields in hudson.slaves declared as FilePathModifier and TypeFieldDescriptionfinal FilePathWorkspaceList.Entry.pathfinal FilePathWorkspaceList.Lease.pathMethods in hudson.slaves that return FilePathModifier and TypeMethodDescriptionstatic FilePathLocates a conventional temporary directory to be associated with a workspace.Methods in hudson.slaves with parameters of type FilePathModifier and TypeMethodDescriptionAcquires the given workspace.Allocates a workspace by adding some variation to the given base to make it unique.static WorkspaceList.LeaseWorkspaceList.Lease.createDummyLease(FilePath p) Creates a dummyWorkspaceList.Leaseobject that does no-op in the release.static WorkspaceList.LeaseWorkspaceList.Lease.createLinkedDummyLease(FilePath p, WorkspaceList.Lease parent) Creates aWorkspaceList.Leaseobject that points to the specified path, but the lock is controlled by the given parent lease object.static hudson.remoting.ChannelChannels.newJVM(String displayName, TaskListener listener, FilePath workDir, ClasspathBuilder classpath, Map<String, String> systemProperties) Deprecated.removed without replacementstatic hudson.remoting.ChannelChannels.newJVM(String displayName, TaskListener listener, JVMBuilder vmb, FilePath workDir, ClasspathBuilder classpath) Deprecated.removed without replacementvoidChannelPinger.preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) voidComputerListener.preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) Called before aComputeris marked online.Just record that this workspace is being used, without paying any attention to the synchronization support.static FilePathLocates a conventional temporary directory to be associated with a workspace.Constructors in hudson.slaves with parameters of type FilePath -
Uses of FilePath in hudson.tasks
Methods in hudson.tasks that return FilePathModifier and TypeMethodDescriptionCommandInterpreter.createScriptFile(FilePath dir) Creates a script file in a temporary name in the specified directory.Methods in hudson.tasks with parameters of type FilePathModifier 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.voidArtifactArchiver.perform(Run<?, ?> build, FilePath ws, EnvVars environment, Launcher launcher, TaskListener listener) voidFingerprinter.perform(Run<?, ?> build, FilePath workspace, EnvVars environment, Launcher launcher, TaskListener listener) -
Uses of FilePath in hudson.tools
Methods in hudson.tools that return FilePathModifier and TypeMethodDescriptionprotected FilePathDownloadFromUrlInstaller.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 FilePathToolInstaller.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 FilePathToolInstaller.preferredLocation(ToolInstallation tool, Node node) Convenience method to find a location to install a tool.Methods in hudson.tools with parameters of type FilePathModifier and TypeMethodDescriptionprotected FilePathDownloadFromUrlInstaller.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 booleanDownloadFromUrlInstaller.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
Methods in hudson.util that return FilePathModifier and TypeMethodDescriptionprotected FilePathFormFieldValidator.WorkspaceFileMask.getBaseDirectory(AbstractProject<?, ?> p) Deprecated.The base directory from which the path name is resolved.protected FilePathFormFieldValidator.WorkspaceFilePath.getBaseDirectory(AbstractProject<?, ?> p) Deprecated.The base directory from which the path name is resolved.static FilePathRemotingDiagnostics.getHeapDump(hudson.remoting.VirtualChannel channel) Obtains the heap dump in an HPROF file.RemotingDiagnostics.HeapDump.obtain()Methods in hudson.util with parameters of type FilePathModifier 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
Methods in jenkins.install that return FilePathModifier and TypeMethodDescriptionSetupWizard.getInitialAdminApiTokenFile()Gets the file used to store the initial admin API Token, in case the system propertySetupWizard.ADMIN_INITIAL_API_TOKENis 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
Methods in jenkins.model that return FilePathModifier and TypeMethodDescriptionJenkins.createPath(String absolutePath) Jenkins.getRootPath()Jenkins.getWorkspaceFor(TopLevelItem item) Methods in jenkins.model with parameters of type FilePathModifier and TypeMethodDescriptionabstract voidArtifactManager.archive(FilePath workspace, Launcher launcher, BuildListener listener, Map<String, String> artifacts) Archive all configured artifacts from a build.voidStandardArtifactManager.archive(FilePath workspace, Launcher launcher, BuildListener listener, Map<String, String> artifacts) -
Uses of FilePath in jenkins.mvn
Methods in jenkins.mvn that return FilePathModifier and TypeMethodDescriptionstatic FilePathGlobalSettingsProvider.getSettingsFilePath(GlobalSettingsProvider settings, AbstractBuild<?, ?> build, TaskListener listener) Convenience method handling allnullchecks.static FilePathSettingsProvider.getSettingsFilePath(SettingsProvider settings, AbstractBuild<?, ?> build, TaskListener listener) Convenience method handling allnullchecks.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 FilePathGlobalSettingsProvider.supplySettings(AbstractBuild<?, ?> build, TaskListener listener) configure maven launcher argument list with adequate settings pathabstract FilePathSettingsProvider.supplySettings(AbstractBuild<?, ?> build, TaskListener listener) Configure maven launcher argument list with adequate settings path. -
Uses of FilePath in jenkins.slaves
Methods in jenkins.slaves that return FilePathModifier and TypeMethodDescriptionabstract FilePathWorkspaceLocator.locate(TopLevelItem item, Node node) Allows extensions to customize the workspace path.Methods in jenkins.slaves with parameters of type FilePathModifier and TypeMethodDescriptionvoidStandardOutputSwapper.preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener) -
Uses of FilePath in jenkins.tasks
Methods in jenkins.tasks with parameters of type FilePathModifier and TypeMethodDescriptiondefault voidSimpleBuildStep.perform(Run<?, ?> run, FilePath workspace, EnvVars env, Launcher launcher, TaskListener listener) Run this step.default voidSimpleBuildStep.perform(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) Deprecated.voidSimpleBuildWrapper.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.voidSimpleBuildWrapper.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
Methods in jenkins.util with parameters of type FilePathModifier and TypeMethodDescriptionstatic VirtualFileVirtualFile.forFilePath(FilePath f) Creates a virtual file wrapper for a remotable file.voidSystemProperties.AgentCopier.preOnline(Computer c, hudson.remoting.Channel channel, FilePath root, TaskListener listener)
Launcher.launch()and its associated builder pattern