提交 60660095 编写于 作者: J Jørgen P. Tjernø

Document parts of FilePath.

FilePath was a little lacking in documentation, this documents getRemote,
createTempFile, createTextTempFile and createTempDir.
上级 c8ccee16
......@@ -307,6 +307,10 @@ public final class FilePath implements Serializable {
return remote.indexOf("\\")==-1;
}
/**
* Gets the full path of the file on the remote machine.
*
*/
public String getRemote() {
return remote;
}
......@@ -939,6 +943,16 @@ public final class FilePath implements Serializable {
/**
* Creates a temporary file in the directory that this {@link FilePath} object designates.
*
* @param prefix
* The prefix string to be used in generating the file's name; must be
* at least three characters long
* @param suffix
* The suffix string to be used in generating the file's name; may be
* null, in which case the suffix ".tmp" will be used
* @return
* The new FilePath pointing to the temporary file
* @see File#createTempFile(String, String)
*/
public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException {
try {
......@@ -954,16 +968,46 @@ public final class FilePath implements Serializable {
}
/**
* Creates a temporary file in this directory and set the contents by the
* Creates a temporary file in this directory and set the contents to the
* given text (encoded in the platform default encoding)
*
* @param prefix
* The prefix string to be used in generating the file's name; must be
* at least three characters long
* @param suffix
* The suffix string to be used in generating the file's name; may be
* null, in which case the suffix ".tmp" will be used
* @param contents
* The initial contents of the temporary file.
* @return
* The new FilePath pointing to the temporary file
* @see File#createTempFile(String, String)
*/
public FilePath createTextTempFile(final String prefix, final String suffix, final String contents) throws IOException, InterruptedException {
return createTextTempFile(prefix,suffix,contents,true);
}
/**
* Creates a temporary file in this directory and set the contents by the
* given text (encoded in the platform default encoding)
* 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)
*
* @param prefix
* The prefix string to be used in generating the file's name; must be
* at least three characters long
* @param suffix
* The suffix string to be used in generating the file's name; may be
* null, in which case the suffix ".tmp" will be used
* @param contents
* The initial contents of the temporary file.
* @param 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)
* @return
* The new FilePath pointing to the temporary file
* @see File#createTempFile(String, String)
*/
public FilePath createTextTempFile(final String prefix, final String suffix, final String contents, final boolean inThisDirectory) throws IOException, InterruptedException {
try {
......@@ -995,7 +1039,17 @@ public final class FilePath implements Serializable {
/**
* Creates a temporary directory inside the directory represented by 'this'
*
* @param prefix
* The prefix string to be used in generating the directory's name;
* must be at least three characters long
* @param suffix
* The suffix string to be used in generating the directory's name; may
* be null, in which case the suffix ".tmp" will be used
* @return
* The new FilePath pointing to the temporary directory
* @since 1.311
* @see File#createTempFile(String, String)
*/
public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException {
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册