maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mic...@apache.org
Subject cvs commit: maven-wagon/wagon-providers/ssh/src/main/java/org/apache/maven/wagon/providers/ssh SFtpWagon.java ScpWagon.java
Date Tue, 02 Dec 2003 18:40:37 GMT
michal      2003/12/02 10:40:37

  Modified:    wagon-providers/ssh/src/main/java/org/apache/maven/wagon/providers/ssh
                        SFtpWagon.java ScpWagon.java
  Log:
  More javadocs and minor changes in the API
  
  Revision  Changes    Path
  1.4       +16 -10    maven-wagon/wagon-providers/ssh/src/main/java/org/apache/maven/wagon/providers/ssh/SFtpWagon.java
  
  Index: SFtpWagon.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ssh/src/main/java/org/apache/maven/wagon/providers/ssh/SFtpWagon.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SFtpWagon.java	26 Nov 2003 21:00:17 -0000	1.3
  +++ SFtpWagon.java	2 Dec 2003 18:40:37 -0000	1.4
  @@ -54,7 +54,9 @@
   import java.io.OutputStream;
   
   /**
  - * An SSH2/SFTP deployer
  + * The Implementation of Wagon which provider for SSH2/SFTP protocol
  + * <br/>
  + * This Wagon is able to set groupId of the artifact only when groupId is an integer
    * 
    * @author Michal Maczka
    * @version $Revision$ $Date$
  @@ -77,10 +79,9 @@
           return channel;
       }
   
  -    /*
  -     * (non-Javadoc)
  +    /**
        * 
  -     * @see org.codehaus.plexus.wagon.deployers.Deployer#init(org.apache.maven.deploy.HostInfo)
  +     * @see org.apache.maven.wagon.Wagon#connect(org.apache.maven.wagon.Repository)
        */
       public void connect( final Repository repository )
               throws AuthenticationException
  @@ -120,12 +121,17 @@
           fireSessionOpened();
       }
   
  -    public void flush()
  +    /**
  +     * Returns {"sftp"}
  +     * @return {"sftp"}
  +     */
  +    public String[] getSupportedProtocols()
       {
  +        final String[] retValue = {"sftp"};
  +        return retValue;
       }
  -
       /**
  -     * @see Deployer#deploy(DeployRequest)
  +     * @see org.apache.maven.wagon.Wagon#transfer(org.apache.maven.wagon.request.PutRequest)
        */
       public void transfer( final PutRequest request ) throws TransferFailedException
       {
  @@ -210,7 +216,7 @@
       }
   
       /**
  -     * @see Deployer#deploy(DeployRequest)
  +     * @see org.apache.maven.wagon.Wagon#transfer(org.apache.maven.wagon.request.GetRequest)
        */
       public void transfer( final GetRequest request ) throws TransferFailedException
       {
  @@ -267,7 +273,7 @@
       }
   
       /**
  -     * @see org.codehaus.plexus.wagon.deployers.Deployer#release()
  +     * @see org.apache.maven.wagon.Wagon#transfer(org.apache.maven.wagon.request.GetRequest)
        */
       public void close()
       {
  
  
  
  1.5       +21 -17    maven-wagon/wagon-providers/ssh/src/main/java/org/apache/maven/wagon/providers/ssh/ScpWagon.java
  
  Index: ScpWagon.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ssh/src/main/java/org/apache/maven/wagon/providers/ssh/ScpWagon.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ScpWagon.java	26 Nov 2003 21:00:17 -0000	1.4
  +++ ScpWagon.java	2 Dec 2003 18:40:37 -0000	1.5
  @@ -58,18 +58,17 @@
   import java.io.OutputStream;
   
   /**
  - * A base class for deployers and fetchers using protocols from SSH2 family and
  - * JSch library for underlining implmenetation
  + * A base class for Wagons Providers for protocols from SSH2 family and
  + * JSch library is used for underlaying implmentation
  + *
    * <p/>
    * This is responsible for authentification stage of the process.
    * <p/>
    * We will first try to use public keys for authentication and if that doesn't
    * work then we fall back to using the login and password
    * 
  - * @version $Id$ @todo
  - *          still have to account for differing setups for people deploying to
  - *          their own sites and to the central repository. @todo improve
  - *          exception handling
  + * @version $Id$
  + *
    */
   public class ScpWagon extends AbstractSshWagon
   {
  @@ -99,13 +98,21 @@
           }
           finally
           {
  -            if ( channel != null )
  -            {
                   channel.disconnect();
  -            }
           }
       }
   
  +
  +    /**
  +     * Returns {"scp"}
  +     * @return {"scp"}
  +     */
  +    public String[] getSupportedProtocols()
  +    {
  +        final String[] retValue = {"scp"};
  +        return retValue;
  +    }
  +
       /**
        * @see org.apache.maven.wagon.Wagon#transfer(org.apache.maven.wagon.request.PutRequest)
        */
  @@ -146,7 +153,7 @@
        * @todo It seems that I need to know "src file linegth" to deploy with
        * scp. I am using InputStream.available() method but it's not safe.
        * <p/>
  -     * Copy artifact to remote host. Code extracted from JSCH exaples
  +     * Copy artifact to remote host.
        */
       private void doCopyTo( final PutRequest request )
               throws TransferFailedException
  @@ -156,7 +163,7 @@
           InputStream is;
           //I/O streams for remote scp
           OutputStream out = null;
  -        InputStream in;
  +        final InputStream in;
   
           try
           {
  @@ -246,10 +253,8 @@
           }
       }
   
  -    /*
  -     * (non-Javadoc)
  -     * 
  -     * @see org.codehaus.plexus.wagon.deployers.Deployer#deploy(org.apache.maven.deploy.DeployRequest)
  +    /**
  +     *
        */
       public void transfer( final GetRequest request )
               throws TransferFailedException
  @@ -258,7 +263,7 @@
           //O streams for local file
           OutputStream os;
           //I/O streams for remote scp
  -        OutputStream out;
  +        final OutputStream out;
           InputStream in = null;
   
           try
  @@ -337,7 +342,6 @@
                   final TransferEvent transferEvent =
                           new TransferEvent(
                                   this,
  -                                getRepository(),
                                   resource,
                                   TransferEvent.TRANSFER_PROGRESS,
                                   TransferEvent.REQUEST_GET );
  
  
  

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


Mime
View raw message