bodewig 2004/06/14 05:23:50
Modified: . WHATSNEW
docs/manual/OptionalTasks scp.html
src/main/org/apache/tools/ant/taskdefs/optional/ssh Scp.java
Log:
Add tofile attributes to scp.
PR: 26758
Revision Changes Path
1.623 +3 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.622
retrieving revision 1.623
diff -u -r1.622 -r1.623
--- WHATSNEW 14 Jun 2004 12:04:39 -0000 1.622
+++ WHATSNEW 14 Jun 2004 12:23:49 -0000 1.623
@@ -148,6 +148,9 @@
* <scp> now properly handles remote files and directories with spaces
in their names. Bugzilla Report 26097.
+* <scp> now has (local|remote)tofile attributes to rename files on the
+ fly. Bugzilla Report 26758.
+
Other changes:
--------------
* doc fix concerning the dependencies of the ftp task
1.14 +14 -0 ant/docs/manual/OptionalTasks/scp.html
Index: scp.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/OptionalTasks/scp.html,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- scp.html 13 Apr 2004 11:09:01 -0000 1.13
+++ scp.html 14 Jun 2004 12:23:50 -0000 1.14
@@ -75,10 +75,24 @@
<td valian="top" align="center">Alternative to todir attribute.</td>
</tr>
<tr>
+ <td valign="top">localTofile</td>
+ <td valign="top">Changes the file name to the given name while
+ receiving it, only useful if receiving a single file. <em>since
+ Ant 1.6.2</em></td>
+ <td valian="top" align="center">Alternative to todir attribute.</td>
+ </tr>
+ <tr>
<td valign="top">remoteTodir</td>
<td valign="top">This is an alternative to the todir
attribute. But this must always point to a remote directory.
<em>since Ant 1.6.2</em></td>
+ <td valian="top" align="center">Alternative to todir attribute.</td>
+ </tr>
+ <tr>
+ <td valign="top">remoteTofile</td>
+ <td valign="top">Changes the file name to the given name while
+ sending it, only useful if sending a single file. <em>since
+ Ant 1.6.2</em></td>
<td valian="top" align="center">Alternative to todir attribute.</td>
</tr>
<tr>
1.17 +22 -1
ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java
Index: Scp.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Scp.java 13 Apr 2004 11:09:01 -0000 1.16
+++ Scp.java 14 Jun 2004 12:23:50 -0000 1.17
@@ -116,6 +116,26 @@
}
/**
+ * Changes the file name to the given name while receiving it,
+ * only useful if receiving a single file.
+ * @since Ant 1.6.2
+ */
+ public void setLocalTofile(String aToUri) {
+ this.toUri = aToUri;
+ this.isToRemote = false;
+ }
+
+ /**
+ * Changes the file name to the given name while sending it,
+ * only useful if sending a single file.
+ * @since Ant 1.6.2
+ */
+ public void setRemoteTofile(String aToUri) {
+ this.toUri = aToUri;
+ this.isToRemote = true;
+ }
+
+ /**
* Adds a FileSet tranfer to remote host. NOTE: Either
* addFileSet() or setFile() are required. But, not both.
*
@@ -137,7 +157,8 @@
public void execute() throws BuildException {
if (toUri == null) {
- throw new BuildException("The 'todir' attribute is required.");
+ throw new BuildException("Either 'todir' or 'tofile' attribute "
+ + "is required.");
}
if (fromUri == null && fileSets == null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]