ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh ScpFromMessage.java
Date Mon, 14 Jun 2004 12:05:03 GMT
bodewig     2004/06/14 05:05:03

  Modified:    .        Tag: ANT_16_BRANCH WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/ssh Tag:
                        ANT_16_BRANCH ScpFromMessage.java
  Log:
  merge
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.503.2.105 +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.503.2.104
  retrieving revision 1.503.2.105
  diff -u -r1.503.2.104 -r1.503.2.105
  --- WHATSNEW	12 Jun 2004 16:54:34 -0000	1.503.2.104
  +++ WHATSNEW	14 Jun 2004 12:05:02 -0000	1.503.2.105
  @@ -110,6 +110,9 @@
   * <zip whenempty="skip"> didn't work in a common situation.  Bugzilla
     Report 22865.
   
  +* <scp> now properly handles remote files and directories with spaces
  +  in their names.  Bugzilla Report 26097.
  +
   Other changes:
   --------------
   * doc fix concerning the dependencies of the ftp task
  
  
  
  No                   revision
  No                   revision
  1.4.2.5   +12 -9     ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java
  
  Index: ScpFromMessage.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/ScpFromMessage.java,v
  retrieving revision 1.4.2.4
  retrieving revision 1.4.2.5
  diff -u -r1.4.2.4 -r1.4.2.5
  --- ScpFromMessage.java	13 Apr 2004 11:26:13 -0000	1.4.2.4
  +++ ScpFromMessage.java	14 Jun 2004 12:05:03 -0000	1.4.2.5
  @@ -122,14 +122,14 @@
   
       private File parseAndCreateDirectory(String serverResponse,
                                            File localFile) {
  -        StringTokenizer token = new StringTokenizer(serverResponse);
  -        String command = token.nextToken();
  -        token.nextToken();  // appears that this is not used and it's zero.
  -        String directoryName = token.nextToken();
  +        int start = serverResponse.indexOf(" ");
  +        // appears that the next token is not used and it's zero.
  +        start = serverResponse.indexOf(" ", start + 1);
  +        String directoryName = serverResponse.substring(start + 1);
           if (localFile.isDirectory()) {
               File dir = new File(localFile, directoryName);
               dir.mkdir();
  -
  +            log("Creating: " + dir);
               return dir;
           }
           return null;
  @@ -139,10 +139,13 @@
                                      File localFile,
                                      OutputStream out,
                                      InputStream in) throws IOException {
  -        StringTokenizer token = new StringTokenizer(serverResponse);
  -        String command = token.nextToken();
  -        int filesize = Integer.parseInt(token.nextToken());
  -        String filename = token.nextToken();
  +        int start = 0;
  +        int end = serverResponse.indexOf(" ", start + 1);
  +        String command = serverResponse.substring(start, end);
  +        start = end + 1;
  +        end = serverResponse.indexOf(" ", start + 1);
  +        int filesize = Integer.parseInt(serverResponse.substring(start, end));
  +        String filename = serverResponse.substring(end + 1);
           log("Receiving: " + filename + " : " + filesize);
           File transferFile = (localFile.isDirectory())
                   ? new File(localFile, filename)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message