You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wagon-commits@maven.apache.org by br...@apache.org on 2005/02/18 05:49:54 UTC

cvs commit: maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon AbstractWagon.java PathUtils.java

brett       2005/02/17 20:49:54

  Modified:    wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh
                        SshCommandExecutor.java
               wagon-provider-api/src/main/java/org/apache/maven/wagon
                        AbstractWagon.java PathUtils.java
  Log:
  tweaks for sharing with the SSH external wagon
  
  Revision  Changes    Path
  1.2       +18 -2     maven-wagon/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/SshCommandExecutor.java
  
  Index: SshCommandExecutor.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/wagon-ssh/src/main/java/org/apache/maven/wagon/providers/ssh/SshCommandExecutor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SshCommandExecutor.java	10 Aug 2004 17:49:15 -0000	1.1
  +++ SshCommandExecutor.java	18 Feb 2005 04:49:54 -0000	1.2
  @@ -1,7 +1,23 @@
   package org.apache.maven.wagon.providers.ssh;
   
  -import org.apache.maven.wagon.Wagon;
  +/*
  + * Copyright 2001-2005 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
  + */
  +
   import org.apache.maven.wagon.TransferFailedException;
  +import org.apache.maven.wagon.Wagon;
   
   /**
    * @author <a href="mailto:mmaczka@interia.pl">Michal Maczka</a>
  
  
  
  1.14      +2 -2      maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
  
  Index: AbstractWagon.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbstractWagon.java	8 Feb 2005 06:42:32 -0000	1.13
  +++ AbstractWagon.java	18 Feb 2005 04:49:54 -0000	1.14
  @@ -46,7 +46,7 @@
   public abstract class AbstractWagon
       implements Wagon
   {
  -    private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
  +    protected static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
   
       protected Repository repository;
   
  
  
  
  1.5       +22 -1     maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java
  
  Index: PathUtils.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PathUtils.java	10 Feb 2005 03:20:59 -0000	1.4
  +++ PathUtils.java	18 Feb 2005 04:49:54 -0000	1.5
  @@ -17,6 +17,7 @@
    * ====================================================================
    */
   
  +import java.io.File;
   import java.util.StringTokenizer;
   
   /**
  @@ -363,4 +364,24 @@
           }
           return null;
       }
  +
  +    // TODO: move to plexus-utils or use something appropriate from there
  +    public static String toRelative( File basedir, String absolutePath )
  +    {
  +        String relative;
  +
  +        absolutePath = absolutePath.replace( '\\', '/' );
  +        String basedirPath = basedir.getAbsolutePath().replace( '\\', '/' );
  +
  +        if ( absolutePath.startsWith( basedirPath ) )
  +        {
  +            relative = absolutePath.substring( basedirPath.length() + 1 );
  +        }
  +        else
  +        {
  +            relative = absolutePath;
  +        }
  +
  +        return relative;
  +    }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org
For additional commands, e-mail: wagon-cvs-help@maven.apache.org