|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.FilePath
public final class FilePath
File
like object with remoting support.
Unlike File
, which always implies a file path on the current computer,
FilePath
represents a file path on a specific slave or the master.
Despite that, FilePath
can be used much like File
. It exposes
a bunch of operations (and we should add more operations as long as they are
generally useful), and when invoked against a file on a remote node, FilePath
executes the necessary code remotely, thereby providing semi-transparent file
operations.
FilePath
smartlyThe transparency makes it easy to write plugins without worrying too much about remoting, by making it works like NFS, where remoting happens at the file-system layer.
But one should note that such use of remoting may not be optional. Sometimes, it makes more sense to move some computation closer to the data, as opposed to move the data to the computation. For example, if you are just computing a MD5 digest of a file, then it would make sense to do the digest on the host where the file is located, as opposed to send the whole data to the master and do MD5 digesting there.
FilePath
supports this "code migration" by in the
act(FileCallable)
method. One can pass in a custom implementation
of FilePath.FileCallable
, to be executed on the node where the data is located.
The following code shows the example:
FilePath file = ...; // make 'file' a fresh empty directory. file.act(new FileCallable<Void>() { // if 'file' is on a different node, this FileCallable will // be transfered to that node and executed there. public Void invoke(File f,VirtualChannel channel) { // f and file represents the same thing f.deleteContents(); f.mkdirs(); } });
When FilePath.FileCallable
is transfered to a remote node, it will be done so
by using the same Java serialization scheme that the remoting module uses.
See Channel
for more about this.
FilePath
itself can be sent over to a remote node as a part of Callable
serialization. For example, sending a FilePath
of a remote node to that
node causes FilePath
to become "local". Similarly, sending a
FilePath
that represents the local computer causes it to become "remote."
Nested Class Summary | |
---|---|
static class |
FilePath.AbstractInterceptorCallableWrapper<T>
Abstract DelegatingCallable that exposes an Before/After pattern for
FilePath.FileCallableWrapperFactory that want to implement AOP-style interceptors |
static interface |
FilePath.FileCallable<T>
Code that gets executed on the machine where the FilePath is local. |
static class |
FilePath.FileCallableWrapperFactory
This extension point allows to contribute a wrapper around a fileCallable so that a plugin can "intercept" a call. |
static class |
FilePath.TarCompression
Supported tar file compression methods. |
Field Summary | |
---|---|
static int |
SIDE_BUFFER_SIZE
|
Constructor Summary | |
---|---|
FilePath(File localPath)
To create FilePath that represents a "local" path. |
|
FilePath(FilePath base,
String rel)
Construct a path starting with a base location. |
|
FilePath(hudson.remoting.VirtualChannel channel,
String remote)
Creates a FilePath that represents a path on the given node. |
Method Summary | ||
---|---|---|
FilePath |
absolutize()
Absolutizes this FilePath and returns the new one. |
|
|
act(hudson.remoting.Callable<V,E> callable)
Executes some program on the machine that this FilePath exists,
so that one can perform local file operations. |
|
|
act(FilePath.FileCallable<T> callable)
Executes some program on the machine that this FilePath exists,
so that one can perform local file operations. |
|
|
actAsync(FilePath.FileCallable<T> callable)
Executes some program on the machine that this FilePath exists,
so that one can perform local file operations. |
|
int |
archive(ArchiverFactory factory,
OutputStream os,
DirScanner scanner)
Archives this directory into the specified archive format, to the given OutputStream , by using
DirScanner to choose what files to include. |
|
int |
archive(ArchiverFactory factory,
OutputStream os,
FileFilter filter)
|
|
int |
archive(ArchiverFactory factory,
OutputStream os,
String glob)
|
|
FilePath |
child(String relOrAbsolute)
The same as FilePath(FilePath,String) but more OO. |
|
void |
chmod(int mask)
Sets the file permission. |
|
void |
copyFrom(org.apache.commons.fileupload.FileItem file)
Place the data from FileItem into the file location specified by this FilePath object. |
|
void |
copyFrom(FilePath src)
Convenience method to call copyTo(FilePath) . |
|
void |
copyFrom(InputStream in)
Replaces the content of this file by the data from the given InputStream . |
|
void |
copyFrom(URL url)
Reads the URL on the current VM, and writes all the data to this FilePath
(this is different from resolving URL remotely.) |
|
int |
copyRecursiveTo(FilePath target)
Copies the contents of this directory recursively into the specified target directory. |
|
int |
copyRecursiveTo(String fileMask,
FilePath target)
Copies the files that match the given file mask to the specified target node. |
|
int |
copyRecursiveTo(String fileMask,
String excludes,
FilePath target)
Copies the files that match the given file mask to the specified target node. |
|
void |
copyTo(FilePath target)
Copies this file to the specified target. |
|
void |
copyTo(OutputStream os)
Sends the contents of this file into the given OutputStream . |
|
void |
copyToWithPermission(FilePath target)
Copies this file to the specified target, with file permissions and other meta attributes intact. |
|
Launcher |
createLauncher(TaskListener listener)
Creates a Launcher for starting processes on the node
that has this file. |
|
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 this FilePath 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) |
|
void |
createZipArchive(OutputStream os)
Deprecated. as of 1.315. Use zip(OutputStream) that has more consistent name. |
|
void |
createZipArchive(OutputStream os,
String glob)
Deprecated. as of 1.315 Use zip(OutputStream,String) that has more consistent name. |
|
boolean |
delete()
Deletes this file. |
|
void |
deleteContents()
Deletes all the contents of this directory, but not the directory itself |
|
void |
deleteRecursive()
Deletes this directory, including all its contents recursively. |
|
String |
digest()
Computes the MD5 digest of the file in hex string. |
|
boolean |
equals(Object o)
|
|
boolean |
exists()
Checks if the file exists. |
|
String |
getBaseName()
Gets the file name portion except the extension. |
|
hudson.remoting.VirtualChannel |
getChannel()
|
|
String |
getName()
Gets just the file name portion without directories. |
|
FilePath |
getParent()
Gets the parent file. |
|
String |
getRemote()
Gets the full path of the file on the remote machine. |
|
int |
hashCode()
|
|
boolean |
installIfNecessaryFrom(URL archive,
TaskListener listener,
String message)
Given a tgz/zip file, extracts it to the given target directory, if necessary. |
|
boolean |
isDirectory()
Checks if the file is a directory. |
|
boolean |
isRemote()
Returns true if this FilePath represents a remote file. |
|
long |
lastModified()
Gets the last modified time stamp of this file, by using the clock of the machine where this file actually resides. |
|
long |
length()
Returns the file size in bytes. |
|
List<FilePath> |
list()
List up files and directories in this directory. |
|
List<FilePath> |
list(FileFilter filter)
List up files in this directory, just like File.listFiles(FileFilter) . |
|
FilePath[] |
list(String includes)
List up files in this directory that matches the given Ant-style filter. |
|
FilePath[] |
list(String includes,
String excludes)
List up files in this directory that matches the given Ant-style filter. |
|
FilePath[] |
list(String includes,
String excludes,
boolean defaultExcludes)
List up files in this directory that matches the given Ant-style filter. |
|
List<FilePath> |
listDirectories()
List up subdirectories. |
|
void |
mkdirs()
Creates this directory. |
|
int |
mode()
Gets the file permission bit mask. |
|
void |
moveAllChildrenTo(FilePath target)
Moves all the contents of this directory into the specified directory, then delete this directory itself. |
|
InputStream |
read()
Reads this file. |
|
String |
readLink()
Resolves symlink, if the given file is a symlink. |
|
String |
readToString()
Reads this file into a string, by using the current system encoding. |
|
void |
renameTo(FilePath target)
Rename this file/directory to the target filepath. |
|
FilePath |
sibling(String rel)
Short for getParent().child(rel) . |
|
void |
symlinkTo(String target,
TaskListener listener)
Creates a symlink to the specified target. |
|
int |
tar(OutputStream out,
DirScanner scanner)
Uses the given scanner on 'this' directory to list up files and then archive it to a tar stream. |
|
int |
tar(OutputStream out,
FileFilter filter)
|
|
int |
tar(OutputStream out,
String glob)
Writes files in 'this' directory to a tar stream. |
|
String |
toString()
Deprecated. |
|
void |
touch(long timestamp)
Creates a file (if not already exist) and sets the timestamp. |
|
URI |
toURI()
Converts this file to the URI, relative to the machine on which this file is available. |
|
void |
untar(FilePath target,
FilePath.TarCompression compression)
When this FilePath represents a tar file, extracts that tar file. |
|
void |
untarFrom(InputStream _in,
FilePath.TarCompression compression)
Reads the given InputStream as a tar file and extracts it into this directory. |
|
void |
unzip(FilePath target)
When this FilePath represents a zip file, extracts that zip file. |
|
void |
unzipFrom(InputStream _in)
Reads the given InputStream as a zip file and extracts it into this directory. |
|
String |
validateAntFileMask(String fileMasks)
Validates the ant file mask (like "foo/bar/*.txt, zot/*.jar") against this directory, and try to point out the problem. |
|
String |
validateAntFileMask(String fileMasks,
int bound)
Like validateAntFileMask(String) but performing only a bounded number of operations. |
|
static FormValidation |
validateFileMask(FilePath pathOrNull,
String value)
Shortcut for validateFileMask(String) in case the left-hand side can be null. |
|
FormValidation |
validateFileMask(String value)
Short for validateFileMask(value,true) |
|
FormValidation |
validateFileMask(String value,
boolean errorIfNotExist)
Checks the GLOB-style file mask. |
|
FormValidation |
validateRelativeDirectory(String value)
|
|
FormValidation |
validateRelativeDirectory(String value,
boolean errorIfNotExist)
A convenience method over validateRelativePath(String, boolean, boolean) . |
|
FormValidation |
validateRelativePath(String value,
boolean errorIfNotExist,
boolean expectingFile)
Validates a relative file path from this FilePath . |
|
FilePath |
withSuffix(String suffix)
Returns a FilePath by adding the given suffix to this path name. |
|
OutputStream |
write()
Writes to this file. |
|
void |
write(String content,
String encoding)
Overwrites this file by placing the given String as the content. |
|
void |
zip(FilePath dst)
|
|
void |
zip(OutputStream os)
Creates a zip file from this directory or a file and sends that to the given output stream. |
|
int |
zip(OutputStream out,
DirScanner scanner)
Uses the given scanner on 'this' directory to list up files and then archive it to a zip stream. |
|
void |
zip(OutputStream os,
FileFilter filter)
Creates a zip file from this directory by using the specified filter, and sends the result to the given output stream. |
|
void |
zip(OutputStream os,
String glob)
Creates a zip file from this directory by only including the files that match the given glob. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static int SIDE_BUFFER_SIZE
Constructor Detail |
---|
public FilePath(hudson.remoting.VirtualChannel channel, String remote)
FilePath
that represents a path on the given node.
channel
- To create a path that represents a remote path, pass in a Channel
that's connected to that machine. If null, that means the local file path.public FilePath(File localPath)
FilePath
that represents a "local" path.
A "local" path means a file path on the computer where the constructor invocation happened.
public FilePath(FilePath base, String rel)
base
- starting point for resolution, and defines channelrel
- a path which if relative will be resolved against baseMethod Detail |
---|
public String getRemote()
public void createZipArchive(OutputStream os) throws IOException, InterruptedException
zip(OutputStream)
that has more consistent name.
IOException
InterruptedException
public void zip(OutputStream os) throws IOException, InterruptedException
IOException
InterruptedException
public void zip(FilePath dst) throws IOException, InterruptedException
IOException
InterruptedException
public void zip(OutputStream os, FileFilter filter) throws IOException, InterruptedException
filter
- Must be serializable since it may be executed remotely. Can be null to add all files.
IOException
InterruptedException
public void createZipArchive(OutputStream os, String glob) throws IOException, InterruptedException
zip(OutputStream,String)
that has more consistent name.
glob
- Ant style glob, like "**/*.xml". If empty or null, this method
works like createZipArchive(OutputStream)
IOException
InterruptedException
public void zip(OutputStream os, String glob) throws IOException, InterruptedException
glob
- Ant style glob, like "**/*.xml". If empty or null, this method
works like createZipArchive(OutputStream)
IOException
InterruptedException
public int zip(OutputStream out, DirScanner scanner) throws IOException, InterruptedException
IOException
InterruptedException
public int archive(ArchiverFactory factory, OutputStream os, DirScanner scanner) throws IOException, InterruptedException
OutputStream
, by using
DirScanner
to choose what files to include.
IOException
InterruptedException
public int archive(ArchiverFactory factory, OutputStream os, FileFilter filter) throws IOException, InterruptedException
IOException
InterruptedException
public int archive(ArchiverFactory factory, OutputStream os, String glob) throws IOException, InterruptedException
IOException
InterruptedException
public void unzip(FilePath target) throws IOException, InterruptedException
FilePath
represents a zip file, extracts that zip file.
target
- Target directory to expand files to. All the necessary directories will be created.
IOException
InterruptedException
unzipFrom(InputStream)
public void untar(FilePath target, FilePath.TarCompression compression) throws IOException, InterruptedException
FilePath
represents a tar file, extracts that tar file.
target
- Target directory to expand files to. All the necessary directories will be created.compression
- Compression mode of this tar file.
IOException
InterruptedException
untarFrom(InputStream, TarCompression)
public void unzipFrom(InputStream _in) throws IOException, InterruptedException
_in
- The stream will be closed by this method after it's fully read.
IOException
InterruptedException
unzip(FilePath)
public FilePath absolutize() throws IOException, InterruptedException
FilePath
and returns the new one.
IOException
InterruptedException
public void symlinkTo(String target, TaskListener listener) throws IOException, InterruptedException
target
- The file that the symlink should point to.listener
- If symlink creation requires a help of an external process, the error will be reported here.
IOException
InterruptedException
public String readLink() throws IOException, InterruptedException
If the resolution fails, report an error.
IOException
InterruptedException
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void untarFrom(InputStream _in, FilePath.TarCompression compression) throws IOException, InterruptedException
_in
- The stream will be closed by this method after it's fully read.compression
- The compression method in use.
IOException
InterruptedException
public boolean installIfNecessaryFrom(URL archive, TaskListener listener, String message) throws IOException, InterruptedException
This method is a convenience method designed for installing a binary package to a location that supports upgrade and downgrade. Specifically,
archive
- The resource that represents the tgz/zip file. This URL must support the "Last-Modified" header.
(Most common usage is to get this from ClassLoader.getResource(String)
)listener
- If non-null, a message will be printed to this listener once this method decides to
extract an archive.
IOException
InterruptedException
public void copyFrom(URL url) throws IOException, InterruptedException
FilePath
(this is different from resolving URL remotely.)
IOException
InterruptedException
public void copyFrom(InputStream in) throws IOException, InterruptedException
InputStream
.
IOException
InterruptedException
public void copyFrom(FilePath src) throws IOException, InterruptedException
copyTo(FilePath)
.
IOException
InterruptedException
public void copyFrom(org.apache.commons.fileupload.FileItem file) throws IOException, InterruptedException
FileItem
into the file location specified by this FilePath
object.
IOException
InterruptedException
public <T> T act(FilePath.FileCallable<T> callable) throws IOException, InterruptedException
FilePath
exists,
so that one can perform local file operations.
IOException
InterruptedException
public <T> hudson.remoting.Future<T> actAsync(FilePath.FileCallable<T> callable) throws IOException, InterruptedException
FilePath
exists,
so that one can perform local file operations.
IOException
InterruptedException
public <V,E extends Throwable> V act(hudson.remoting.Callable<V,E> callable) throws IOException, InterruptedException, E extends Throwable
FilePath
exists,
so that one can perform local file operations.
IOException
InterruptedException
E extends Throwable
public URI toURI() throws IOException, InterruptedException
IOException
InterruptedException
public void mkdirs() throws IOException, InterruptedException
IOException
InterruptedException
public void deleteRecursive() throws IOException, InterruptedException
IOException
InterruptedException
public void deleteContents() throws IOException, InterruptedException
IOException
InterruptedException
public String getBaseName()
public String getName()
public FilePath sibling(String rel)
getParent().child(rel)
. Useful for getting other files in the same directory.
public FilePath withSuffix(String suffix)
FilePath
by adding the given suffix to this path name.
public FilePath child(String relOrAbsolute)
FilePath(FilePath,String)
but more OO.
relOrAbsolute
- a relative or absolute path
public FilePath getParent()
public FilePath createTempFile(String prefix, String suffix) throws IOException, InterruptedException
FilePath
object designates.
prefix
- The prefix string to be used in generating the file's name; must be
at least three characters longsuffix
- The suffix string to be used in generating the file's name; may be
null, in which case the suffix ".tmp" will be used
IOException
InterruptedException
File.createTempFile(String, String)
public FilePath createTextTempFile(String prefix, String suffix, String contents) throws IOException, InterruptedException
prefix
- The prefix string to be used in generating the file's name; must be
at least three characters longsuffix
- The suffix string to be used in generating the file's name; may be
null, in which case the suffix ".tmp" will be usedcontents
- The initial contents of the temporary file.
IOException
InterruptedException
File.createTempFile(String, String)
public FilePath createTextTempFile(String prefix, String suffix, String contents, boolean inThisDirectory) throws IOException, InterruptedException
prefix
- The prefix string to be used in generating the file's name; must be
at least three characters longsuffix
- The suffix string to be used in generating the file's name; may be
null, in which case the suffix ".tmp" will be usedcontents
- The initial contents of the temporary file.inThisDirectory
- If true, then create this temporary in the directory pointed to by
this.
If false, then the temporary file is created in the system temporary
directory (java.io.tmpdir)
IOException
InterruptedException
File.createTempFile(String, String)
public FilePath createTempDir(String prefix, String suffix) throws IOException, InterruptedException
prefix
- The prefix string to be used in generating the directory's name;
must be at least three characters longsuffix
- The suffix string to be used in generating the directory's name; may
be null, in which case the suffix ".tmp" will be used
IOException
InterruptedException
File.createTempFile(String, String)
public boolean delete() throws IOException, InterruptedException
IOException
- if it exists but could not be successfully deleted
InterruptedException
public boolean exists() throws IOException, InterruptedException
IOException
InterruptedException
public long lastModified() throws IOException, InterruptedException
IOException
InterruptedException
File.lastModified()
,
touch(long)
public void touch(long timestamp) throws IOException, InterruptedException
IOException
InterruptedException
public boolean isDirectory() throws IOException, InterruptedException
IOException
InterruptedException
public long length() throws IOException, InterruptedException
IOException
InterruptedException
public void chmod(int mask) throws IOException, InterruptedException
mask
- File permission mask. To simplify the permission copying,
if the parameter is -1, this method becomes no-op.
please note mask is expected to be an octal if you use chmod command line values,
so preceded by a '0' in java notation, ie chmod(0644)
IOException
InterruptedException
mode()
public int mode() throws IOException, InterruptedException, PosixException
IOException
InterruptedException
PosixException
chmod(int)
public List<FilePath> list() throws IOException, InterruptedException
This method returns direct children of the directory denoted by the 'this' object.
IOException
InterruptedException
public List<FilePath> listDirectories() throws IOException, InterruptedException
IOException
InterruptedException
public List<FilePath> list(FileFilter filter) throws IOException, InterruptedException
File.listFiles(FileFilter)
.
filter
- The optional filter used to narrow down the result.
If non-null, must be Serializable
.
If this FilePath
represents a remote path,
the filter object will be executed on the remote machine.
IOException
InterruptedException
public FilePath[] list(String includes) throws IOException, InterruptedException
includes
- See FileSet
for the syntax. String like "foo/*.zip" or "foo/**/*.xml"
IOException
InterruptedException
public FilePath[] list(String includes, String excludes) throws IOException, InterruptedException
includes
- excludes
- See FileSet
for the syntax. String like "foo/*.zip" or "foo/**/*.xml"
IOException
InterruptedException
public FilePath[] list(String includes, String excludes, boolean defaultExcludes) throws IOException, InterruptedException
includes
- excludes
- See FileSet
for the syntax. String like "foo/*.zip" or "foo/**/*.xml"defaultExcludes
- whether to use the ant default excludes
IOException
InterruptedException
public InputStream read() throws IOException
IOException
public String readToString() throws IOException
IOException
public OutputStream write() throws IOException, InterruptedException
I/O operation to remote FilePath
happens asynchronously, meaning write operations to the returned
OutputStream
will return without receiving a confirmation from the remote that the write happened.
I/O operations also happens asynchronously from the Channel.call(Callable)
operations, so if
you write to a remote file and then execute Channel.call(Callable)
and try to access the newly copied
file, it might not be fully written yet.
IOException
InterruptedException
public void write(String content, String encoding) throws IOException, InterruptedException
encoding
- Null to use the platform default encoding.
IOException
InterruptedException
public String digest() throws IOException, InterruptedException
IOException
InterruptedException
public void renameTo(FilePath target) throws IOException, InterruptedException
IOException
InterruptedException
public void moveAllChildrenTo(FilePath target) throws IOException, InterruptedException
IOException
InterruptedException
public void copyTo(FilePath target) throws IOException, InterruptedException
IOException
InterruptedException
public void copyToWithPermission(FilePath target) throws IOException, InterruptedException
IOException
InterruptedException
public void copyTo(OutputStream os) throws IOException, InterruptedException
OutputStream
.
IOException
InterruptedException
public int copyRecursiveTo(FilePath target) throws IOException, InterruptedException
IOException
InterruptedException
public int copyRecursiveTo(String fileMask, FilePath target) throws IOException, InterruptedException
fileMask
- Ant GLOB pattern.
String like "foo/bar/*.xml" Multiple patterns can be separated
by ',', and whitespace can surround ',' (so that you can write
"abc, def" and "abc,def" to mean the same thing.
IOException
InterruptedException
public int copyRecursiveTo(String fileMask, String excludes, FilePath target) throws IOException, InterruptedException
fileMask
- Ant GLOB pattern.
String like "foo/bar/*.xml" Multiple patterns can be separated
by ',', and whitespace can surround ',' (so that you can write
"abc, def" and "abc,def" to mean the same thing.excludes
- Files to be excluded. Can be null.
IOException
InterruptedException
public int tar(OutputStream out, String glob) throws IOException, InterruptedException
glob
- Ant file pattern mask, like "**/*.java".
IOException
InterruptedException
public int tar(OutputStream out, FileFilter filter) throws IOException, InterruptedException
IOException
InterruptedException
public int tar(OutputStream out, DirScanner scanner) throws IOException, InterruptedException
IOException
InterruptedException
public Launcher createLauncher(TaskListener listener) throws IOException, InterruptedException
Launcher
for starting processes on the node
that has this file.
IOException
InterruptedException
public String validateAntFileMask(String fileMasks) throws IOException, InterruptedException
This is useful in conjunction with FormValidation
.
IOException
InterruptedException
validateFileMask(FilePath, String)
public String validateAntFileMask(String fileMasks, int bound) throws IOException, InterruptedException
validateAntFileMask(String)
but performing only a bounded number of operations.
Whereas the unbounded overload is appropriate for calling from cancelable, long-running tasks such as build steps,
this overload should be used when an answer is needed quickly, such as for validateFileMask(String)
or anything else returning FormValidation
.
If a positive match is found, null
is returned immediately.
A message is returned in case the file pattern can definitely be determined to not match anything in the directory within the alloted time.
If the time runs out without finding a match but without ruling out the possibility that there might be one, InterruptedException
is thrown,
in which case the calling code should give the user the benefit of the doubt and use FormValidation.Kind.OK
(with or without a message).
bound
- a maximum number of negative operations (deliberately left vague) to perform before giving up on a precise answer; 10_000 is a reasonable pick
InterruptedException
- not only in case of a channel failure, but also if too many operations were performed without finding any matches
IOException
public static FormValidation validateFileMask(FilePath pathOrNull, String value) throws IOException
validateFileMask(String)
in case the left-hand side can be null.
IOException
public FormValidation validateFileMask(String value) throws IOException
validateFileMask(value,true)
IOException
public FormValidation validateFileMask(String value, boolean errorIfNotExist) throws IOException
validateAntFileMask(String)
.
Requires configure permission on ancestor AbstractProject object in request,
or admin permission if no such ancestor is found.
IOException
public FormValidation validateRelativePath(String value, boolean errorIfNotExist, boolean expectingFile) throws IOException
FilePath
.
Requires configure permission on ancestor AbstractProject object in request,
or admin permission if no such ancestor is found.
value
- The relative path being validated.errorIfNotExist
- If true, report an error if the given relative path doesn't exist. Otherwise it's a warning.expectingFile
- If true, we expect the relative path to point to a file.
Otherwise, the relative path is expected to be pointing to a directory.
IOException
public FormValidation validateRelativeDirectory(String value, boolean errorIfNotExist) throws IOException
validateRelativePath(String, boolean, boolean)
.
IOException
public FormValidation validateRelativeDirectory(String value) throws IOException
IOException
@Deprecated public String toString()
toString
in class Object
public hudson.remoting.VirtualChannel getChannel()
public boolean isRemote()
FilePath
represents a remote file.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |