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 mi...@apache.org on 2004/02/08 20:44:13 UTC

cvs commit: maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/result ByteArrayResult.java

michal      2004/02/08 11:44:13

  Modified:    wagon-providers/ssh project.xml
               wagon-maven-bindings project.xml
               wagon-api/src/main/java/org/apache/maven/wagon/managers
                        WagonManager.java DefaultWagonManager.java
                        RepositoryManager.java
               wagon-maven-bindings/src/test/java/org/apache/maven/wagon/bindings
                        MavenRepositoryManagerTest.java
               wagon-providers/http project.xml
               wagon-maven-bindings/src/main/java/org/apache/maven/wagon/bindings
                        MavenRepositoryManager.java
               wagon-providers/ftp project.xml
               wagon-providers/file project.xml
               .        project.properties
               wagon-api project.xml
               wagon-api/src/main/java/org/apache/maven/wagon/result
                        ByteArrayResult.java
  Added:       wagon-api/src/main/java/org/apache/maven/wagon/managers
                        DefaultRepositoryManager.java
               wagon-plexus-bindings/src/main/java/org/apache/maven/wagon/plexus
                        PlexusWagonManager.java
               wagon-plexus-bindings/src/test/java/org/apache/maven/wagon/plexus
                        PlexusWagonManagerTest.java
                        PlexusWagonManagerTest.xml
               wagon-plexus-bindings .cvsignore project.xml
               wagon-plexus-bindings/src/main/resources/META-INF/plexus
                        components.xml
  Log:
  Added wagon-plexus-bindings. Now groupId of all subprojects is "maven-wagon" not "wagon"
  
  Revision  Changes    Path
  1.6       +2 -2      maven-wagon/wagon-providers/ssh/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ssh/project.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- project.xml	10 Dec 2003 18:57:21 -0000	1.5
  +++ project.xml	8 Feb 2004 19:44:12 -0000	1.6
  @@ -3,7 +3,7 @@
   <project>
       <pomVersion>3</pomVersion>
       <id>wagon-ssh-provider</id>
  -    <groupId>wagon</groupId>
  +    <groupId>maven-wagon</groupId>
       <artifactId>wagon-ssh-provider</artifactId>
       <name>Wagon SSH provider</name>
       <currentVersion>1.0-beta-1</currentVersion>
  @@ -58,7 +58,7 @@
       <dependencies>
   
           <dependency>
  -            <groupId>wagon</groupId>
  +            <groupId>maven-wagon</groupId>
               <artifactId>wagon-api</artifactId>
               <version>1.0-beta-1</version>
               <type>jar</type>
  
  
  
  1.3       +3 -3      maven-wagon/wagon-maven-bindings/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-maven-bindings/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	7 Dec 2003 15:20:47 -0000	1.2
  +++ project.xml	8 Feb 2004 19:44:12 -0000	1.3
  @@ -3,7 +3,7 @@
   <project>
       <pomVersion>3</pomVersion>
       <id>wagon-maven-bindings</id>
  -    <groupId>wagon</groupId>
  +    <groupId>maven-wagon</groupId>
       <artifactId>wagon-maven-bindings</artifactId>
       <type>jar</type>
       <name>Wagon Maven Bindings</name>
  @@ -60,12 +60,12 @@
       <dependencies>
   
           <dependency>
  -            <groupId>wagon</groupId>
  +            <groupId>maven-wagon</groupId>
               <artifactId>wagon-api</artifactId>
               <version>1.0-beta-1</version>
               <type>jar</type>
           </dependency>
  -            
  +
       </dependencies>
   
       <build>
  
  
  
  1.6       +2 -8      maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/WagonManager.java
  
  Index: WagonManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/WagonManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WagonManager.java	11 Dec 2003 21:21:03 -0000	1.5
  +++ WagonManager.java	8 Feb 2004 19:44:13 -0000	1.6
  @@ -61,14 +61,8 @@
    */
   public interface WagonManager
   {
  -    /**
  -     * Registers given WagonFactory and all supported protocols
  -     * 
  -     * 
  -     * @param wagonFactory
  -     */
  -	public void addWagonFactory( WagonFactory wagonFactory );
   
  +    String ROLE = WagonManager.class.getName();
   
       /**
        * Returns Wagon which "understands" given protcol
  
  
  
  1.6       +19 -17    maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/DefaultWagonManager.java
  
  Index: DefaultWagonManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/DefaultWagonManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultWagonManager.java	11 Dec 2003 21:21:03 -0000	1.5
  +++ DefaultWagonManager.java	8 Feb 2004 19:44:13 -0000	1.6
  @@ -1,11 +1,11 @@
   package org.apache.maven.wagon.managers;
   
   /*
  - * ==================================================================== The
  - * Apache Software License, Version 1.1
  - * 
  + * ====================================================================
  + * TheApache Software License, Version 1.1
  + *
    * Copyright (c) 2003 The Apache Software Foundation. All rights reserved.
  - * 
  + *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions are met: 1.
    * Redistributions of source code must retain the above copyright notice, this
  @@ -24,7 +24,7 @@
    * Products derived from this software may not be called "Apache", "Apache
    * Maven", nor may "Apache" appear in their name, without prior written
    * permission of the Apache Software Foundation.
  - * 
  + *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
    * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
    * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  @@ -36,11 +36,11 @@
    * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    * ====================================================================
  - * 
  + *
    * This software consists of voluntary contributions made by many individuals
    * on behalf of the Apache Software Foundation. For more information on the
    * Apache Software Foundation, please see <http://www.apache.org/> .
  - * 
  + *
    * ====================================================================
    */
   
  @@ -67,8 +67,11 @@
       private Map wagonProtocolMap = new HashMap();
   
   
  -    /**
  -     * @todo review this
  +     /**
  +     * Registers given WagonFactory and all supported protocols
  +     *
  +     *
  +     * @param wagonFactory
        */
       public synchronized void addWagonFactory( final WagonFactory wagonFactory )
       {
  @@ -77,28 +80,27 @@
               wagonFactories = new ArrayList();
           }
           wagonFactories.add( wagonFactory );
  +        
           final String[] supportedProtocols = wagonFactory.getSupportedProtocols();
  +
           for ( int i = 0; i < supportedProtocols.length; i++ )
           {
           	wagonProtocolMap.put( supportedProtocols[i], wagonFactory );
           }
       }
   
  +
  +
       /**
  -     * @param repository 
  -     * 
  -     * @return 
  +     * @see WagonManager#getWagon(java.lang.String)
        */
       public Wagon getWagon( final String protocol ) throws UnsupportedProtocolException
       {        
           if ( !wagonProtocolMap.containsKey( protocol ) )
           {
  -          throw new UnsupportedProtocolException( "Cannot find WagonFactory for: " +  protocol );
  +            throw new UnsupportedProtocolException( "Cannot find WagonFactory for: " +  protocol );
           }         
           final WagonFactory wagonFactory = ( WagonFactory ) wagonProtocolMap.get( protocol );
           return wagonFactory.createWagon( protocol );
       }
  -
  -    
  -
   }
  
  
  
  1.6       +14 -167   maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/RepositoryManager.java
  
  Index: RepositoryManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/RepositoryManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RepositoryManager.java	11 Dec 2003 21:21:03 -0000	1.5
  +++ RepositoryManager.java	8 Feb 2004 19:44:13 -0000	1.6
  @@ -1,179 +1,26 @@
  -package org.apache.maven.wagon.managers;
  -
   /*
  - * ====================================================================== 
  - * The Apache Software License, Version 1.1
  - * 
  - * Copyright (c) 2003 The Apache Software Foundation. All rights reserved.
  - * 
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions are met: 1.
  - * Redistributions of source code must retain the above copyright notice, this
  - * list of conditions and the following disclaimer. 2. Redistributions in
  - * binary form must reproduce the above copyright notice, this list of
  - * conditions and the following disclaimer in the documentation and/or other
  - * materials provided with the distribution. 3. The end-userName documentation
  - * included with the redistribution, if any, must include the following
  - * acknowledgment: "This product includes software developed by the Apache
  - * Software Foundation (http://www.apache.org/)." Alternately, this
  - * acknowledgment may appear in the software itself, if and wherever such
  - * third-party acknowledgments normally appear. 4. The names "Apache" and
  - * "Apache Software Foundation" and "Apache Maven" must not be used to endorse
  - * or promote products derived from this software without prior written
  - * permission. For written permission, please contact apache@apache.org. 5.
  - * Products derived from this software may not be called "Apache", "Apache
  - * Maven", nor may "Apache" appear in their name, without prior written
  - * permission of the Apache Software Foundation.
  - * 
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  - * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  - * ====================================================================
  - * 
  - * This software consists of voluntary contributions made by many individuals
  - * on behalf of the Apache Software Foundation. For more information on the
  - * Apache Software Foundation, please see <http://www.apache.org/> .
  - * 
  - * ====================================================================
  + * Created by IntelliJ IDEA.
  + * User: Michal
  + * Date: 2004-02-08
  + * Time: 15:36:43
    */
  +package org.apache.maven.wagon.managers;
   
   import org.apache.maven.wagon.Repository;
  -import org.apache.maven.wagon.UnsupportedProtocolException;
  -import org.apache.maven.wagon.Wagon;
  -import org.apache.maven.wagon.events.SessionListener;
   import org.apache.maven.wagon.events.TransferListener;
  -import org.apache.maven.wagon.request.GetRequest;
  -import org.apache.maven.wagon.request.PutRequest;
  +import org.apache.maven.wagon.events.SessionListener;
   
   import java.io.File;
  -import java.io.Serializable;
  -import java.util.Collections;
  -import java.util.HashSet;
  -import java.util.Iterator;
  -import java.util.Set;
  -
  -/**
  - * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
  - * @version $Id$
  - */
  -public class RepositoryManager implements Serializable
  +
  +public interface RepositoryManager
   {
  -    private Set repositories = new HashSet();
  +    boolean add( Repository repository );
  +
  +    boolean remove( Repository repository );
   
  -    private WagonManager wagonManager;
  +    boolean getFromAny( File file, String resource, final TransferListener transferListener, final SessionListener sessionListener );
   
  -    /**
  -     * @param repository 
  -     * 
  -     * @return 
  -     */
  -    public boolean add( final Repository repository )
  -    {
  -        return repositories.add( repository );
  -    }
  -
  -    /**
  -     * @param repository 
  -     */
  -    public boolean remove( final Repository repository )
  -    {
  -        return repositories.remove( repository );
  -    }
  -
  -    void putToAll( final File file, final String resource, final TransferListener transferListener, final SessionListener sessionListener )
  -    {
  -
  -        for ( Iterator iter = repositories.iterator(); iter.hasNext(); )
  -        {
  -            final Repository repository = ( Repository ) iter.next();
  -
  -            try
  -            {
  -                final Wagon wagon = wagonManager.getWagon( repository.getProtocol() );
  -                wagon.addSessionListener( sessionListener );
  -                wagon.addTransferListener( transferListener );
  -                wagon.connect( repository );
  -                final PutRequest putRequest = new PutRequest( file, resource );
  -                wagon.transfer( putRequest );
  -
  -            }
  -            catch ( UnsupportedProtocolException e )
  -            {
  -                System.out.println( "No provider for:" + repository );
  -                continue;
  -
  -            }
  -            catch ( Exception e )
  -            {
  -            }
  -
  -        }
  -    }
  -
  -    public boolean getFromAny( final File file, final String resource )
  -    {
  -
  -        final File temp = new File( file.getAbsolutePath() + ".tmp" );
  -        boolean transfered = false;
  -        for ( Iterator iter = repositories.iterator(); iter.hasNext(); )
  -        {
  -            final Repository repository = ( Repository ) iter.next();
  -
  -            try
  -            {
  -                final Wagon wagon = wagonManager.getWagon( repository.getProtocol() );
  -                wagon.connect( repository );
  -                final GetRequest getRequest = new GetRequest( resource, temp );
  -                wagon.transfer( getRequest );
  -                transfered = true;
  -
  -            }
  -            catch ( Exception e )
  -            {
  -                e.printStackTrace();
  -                continue;
  -            }
  -
  -        }
  -
  -        if ( transfered )
  -        {
  -            return temp.renameTo( file );
  -        }
  -        return false;
  -
  -    }
  -
  -    /**
  -     * @return Returns the wagonManager.
  -     */
  -    public WagonManager getWagonManager()
  -    {
  -        return wagonManager;
  -    }
  -
  -    /**
  -     * @param wagonManager The wagonManager to set.
  -     */
  -    public void setWagonManager( final WagonManager wagonManager )
  -    {
  -        this.wagonManager = wagonManager;
  -    }
  -
  -    /**
  -     * 
  -     */
  -    public Set getRepositories()
  -    {
  -        return Collections.unmodifiableSet( repositories );
  +    void putToAll( final File file, final String resource, final TransferListener transferListener, final SessionListener sessionListener );
   
  -    }
   
  -}
  +}
  \ No newline at end of file
  
  
  
  1.1                  maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/managers/DefaultRepositoryManager.java
  
  Index: DefaultRepositoryManager.java
  ===================================================================
  package org.apache.maven.wagon.managers;
  
  /*
   * ====================================================================== 
   * The Apache Software License, Version 1.1
   * 
   * Copyright (c) 2003 The Apache Software Foundation. All rights reserved.
   * 
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met: 1.
   * Redistributions of source code must retain the above copyright notice, this
   * list of conditions and the following disclaimer. 2. Redistributions in
   * binary form must reproduce the above copyright notice, this list of
   * conditions and the following disclaimer in the documentation and/or other
   * materials provided with the distribution. 3. The end-userName documentation
   * included with the redistribution, if any, must include the following
   * acknowledgment: "This product includes software developed by the Apache
   * Software Foundation (http://www.apache.org/)." Alternately, this
   * acknowledgment may appear in the software itself, if and wherever such
   * third-party acknowledgments normally appear. 4. The names "Apache" and
   * "Apache Software Foundation" and "Apache Maven" must not be used to endorse
   * or promote products derived from this software without prior written
   * permission. For written permission, please contact apache@apache.org. 5.
   * Products derived from this software may not be called "Apache", "Apache
   * Maven", nor may "Apache" appear in their name, without prior written
   * permission of the Apache Software Foundation.
   * 
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   * 
   * This software consists of voluntary contributions made by many individuals
   * on behalf of the Apache Software Foundation. For more information on the
   * Apache Software Foundation, please see <http://www.apache.org/> .
   * 
   * ====================================================================
   */
  
  import org.apache.maven.wagon.Repository;
  import org.apache.maven.wagon.UnsupportedProtocolException;
  import org.apache.maven.wagon.Wagon;
  import org.apache.maven.wagon.events.SessionListener;
  import org.apache.maven.wagon.events.TransferListener;
  import org.apache.maven.wagon.request.GetRequest;
  import org.apache.maven.wagon.request.PutRequest;
  
  import java.io.File;
  import java.io.Serializable;
  import java.util.Collections;
  import java.util.HashSet;
  import java.util.Iterator;
  import java.util.Set;
  
  /**
   * @author <a href="michal.maczka@dimatics.com">Michal Maczka</a>
   * @version $Id: DefaultRepositoryManager.java,v 1.1 2004/02/08 19:44:13 michal Exp $
   */
  public class DefaultRepositoryManager implements Serializable, RepositoryManager
  {
      private Set repositories = new HashSet();
  
      private WagonManager wagonManager;
  
      /**
       * @param repository 
       * 
       * @return 
       */
      public boolean add( final Repository repository )
      {
          return repositories.add( repository );
      }
  
      /**
       * @param repository 
       */
      public boolean remove( final Repository repository )
      {
          return repositories.remove( repository );
      }
  
  
      public void putToAll( final File file, final String resource, final TransferListener transferListener, final SessionListener sessionListener )
      {
  
          for ( Iterator iter = repositories.iterator(); iter.hasNext(); )
          {
              final Repository repository = ( Repository ) iter.next();
  
              try
              {
                  final Wagon wagon = wagonManager.getWagon( repository.getProtocol() );
                  if ( sessionListener != null )
                  {
                      wagon.addSessionListener( sessionListener );
                  }
                  if ( transferListener != null )
                  {
                      wagon.addTransferListener( transferListener );
                  }
                  wagon.connect( repository );
                  final PutRequest putRequest = new PutRequest( file, resource );
                  wagon.transfer( putRequest );
  
              }
              catch ( UnsupportedProtocolException e )
              {
                  System.out.println( "No provider for:" + repository );
                  continue;
  
              }
              catch ( Exception e )
              {
              }
  
          }
      }
  
      public boolean getFromAny( File file, String resource, TransferListener transferListener, SessionListener sessionListener )
      {
  
          final File temp = new File( file.getAbsolutePath() + ".tmp" );
          boolean transfered = false;
          for ( Iterator iter = repositories.iterator(); iter.hasNext(); )
          {
              final Repository repository = ( Repository ) iter.next();
              try
              {
                  final Wagon wagon = wagonManager.getWagon( repository.getProtocol() );
                  wagon.connect( repository );
                  final GetRequest getRequest = new GetRequest( resource, temp );
                  wagon.transfer( getRequest );
                  transfered = true;
              }
              catch ( Exception e )
              {
                  e.printStackTrace();
                  continue;
              }
          }
  
          if ( transfered )
          {
              temp.renameTo( file );
          }
          temp.delete();
          return transfered;
  
      }
  
      /**
       * @return Returns the wagonManager.
       */
      public WagonManager getWagonManager()
      {
          return wagonManager;
      }
  
      /**
       * @param wagonManager The wagonManager to set.
       */
      public void setWagonManager( final WagonManager wagonManager )
      {
          this.wagonManager = wagonManager;
      }
  
      /**
       * 
       */
      public Set getRepositories()
      {
          return Collections.unmodifiableSet( repositories );
  
      }
  
  }
  
  
  
  1.1                  maven-wagon/wagon-plexus-bindings/src/main/java/org/apache/maven/wagon/plexus/PlexusWagonManager.java
  
  Index: PlexusWagonManager.java
  ===================================================================
  package org.apache.maven.wagon.plexus;
  
  /*
   * ==================================================================== The
   * Apache Software License, Version 1.1
   * 
   * Copyright (c) 2003 The Apache Software Foundation. All rights reserved.
   * 
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met: 1.
   * Redistributions of source code must retain the above copyright notice, this
   * list of conditions and the following disclaimer. 2. Redistributions in
   * binary form must reproduce the above copyright notice, this list of
   * conditions and the following disclaimer in the documentation and/or other
   * materials provided with the distribution. 3. The end-userName documentation
   * included with the redistribution, if any, must include the following
   * acknowledgment: "This product includes software developed by the Apache
   * Software Foundation (http://www.apache.org/)." Alternately, this
   * acknowledgment may appear in the software itself, if and wherever such
   * third-party acknowledgments normally appear. 4. The names "Apache" and
   * "Apache Software Foundation" and "Apache Maven" must not be used to endorse
   * or promote products derived from this software without prior written
   * permission. For written permission, please contact apache@apache.org. 5.
   * Products derived from this software may not be called "Apache", "Apache
   * Maven", nor may "Apache" appear in their name, without prior written
   * permission of the Apache Software Foundation.
   * 
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   * 
   * This software consists of voluntary contributions made by many individuals
   * on behalf of the Apache Software Foundation. For more information on the
   * Apache Software Foundation, please see <http://www.apache.org/> .
   * 
   * ====================================================================
   */
  
  import org.apache.maven.wagon.UnsupportedProtocolException;
  import org.apache.maven.wagon.Wagon;
  import org.apache.maven.wagon.WagonFactory;
  import org.apache.maven.wagon.managers.WagonManager;
  import org.codehaus.plexus.logging.AbstractLogEnabled;
  import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
  
  import java.util.Iterator;
  import java.util.List;
  import java.util.Map;
  import java.util.HashMap;
  
  /**
   * @author <a href="mmaczka@interia.pl">Michal Maczka</a>
   * @version $Id: PlexusWagonManager.java,v 1.1 2004/02/08 19:44:13 michal Exp $
   */
  
  public class PlexusWagonManager extends AbstractLogEnabled implements WagonManager, Initializable
  {
      public List wagonFactories;
  
      public Map wagonFactoryProtocolMap = new HashMap();
  
      public Wagon getWagon( final String protocol ) throws UnsupportedProtocolException
      {
          if ( !wagonFactoryProtocolMap.containsKey( protocol ) )
          {
              throw new UnsupportedProtocolException( "Unsupported protcol: " + protocol );
          }
          final WagonFactory factory = ( WagonFactory ) wagonFactoryProtocolMap.get( protocol );
          return factory.createWagon( protocol );
      }
  
      public void initialize() throws Exception
      {
          if ( wagonFactories == null )
          {
              getLogger().error( "No Wagon factory was found" );
              return;
          }
          for ( Iterator iterator = wagonFactories.iterator(); iterator.hasNext(); )
          {
              final WagonFactory wagonFactory = ( WagonFactory ) iterator.next();
              final String[] protocols = wagonFactory.getSupportedProtocols();
              for ( int i = 0; i < protocols.length; i++ )
              {
                  final String protocol = protocols[i];
                  wagonFactoryProtocolMap.put( protocol, wagonFactory );
              }
          }
      }
  }
  
  
  
  1.2       +2 -2      maven-wagon/wagon-maven-bindings/src/test/java/org/apache/maven/wagon/bindings/MavenRepositoryManagerTest.java
  
  Index: MavenRepositoryManagerTest.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-maven-bindings/src/test/java/org/apache/maven/wagon/bindings/MavenRepositoryManagerTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MavenRepositoryManagerTest.java	7 Dec 2003 15:00:01 -0000	1.1
  +++ MavenRepositoryManagerTest.java	8 Feb 2004 19:44:13 -0000	1.2
  @@ -97,7 +97,7 @@
            context.put("maven.repo.remote", repos);
            
            
  -         File mavenHomeLocal = new File ( System.getProperty( "basedir" ), "src/test/test-data/mavenHomeLocal" ) ;
  +         final File mavenHomeLocal = new File ( System.getProperty( "basedir" ), "src/test/test-data/mavenHomeLocal" ) ;
            context.put("maven.home.local", mavenHomeLocal.getAbsolutePath() );
   
            repositoryManager.configure( context  );
  
  
  
  1.8       +2 -2      maven-wagon/wagon-providers/http/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/http/project.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- project.xml	10 Dec 2003 18:44:13 -0000	1.7
  +++ project.xml	8 Feb 2004 19:44:13 -0000	1.8
  @@ -3,7 +3,7 @@
   <project>
       <pomVersion>3</pomVersion>
       <id>wagon-http-provider</id>
  -    <groupId>wagon</groupId>
  +    <groupId>maven-wagon</groupId>
       <artifactId>wagon-http-provider</artifactId>
       <type>jar</type>
       <name>Wagon HTTP provider</name>
  @@ -59,7 +59,7 @@
       <dependencies>
   
           <dependency>
  -            <groupId>wagon</groupId>
  +            <groupId>maven-wagon</groupId>
               <artifactId>wagon-api</artifactId>
               <version>1.0-beta-1</version>
               <type>jar</type>
  
  
  
  1.2       +16 -2     maven-wagon/wagon-maven-bindings/src/main/java/org/apache/maven/wagon/bindings/MavenRepositoryManager.java
  
  Index: MavenRepositoryManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-maven-bindings/src/main/java/org/apache/maven/wagon/bindings/MavenRepositoryManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MavenRepositoryManager.java	7 Dec 2003 15:00:01 -0000	1.1
  +++ MavenRepositoryManager.java	8 Feb 2004 19:44:13 -0000	1.2
  @@ -201,14 +201,28 @@
   
       }
   
  +
  +    /**
  +     *  Converts an url like
  +     *  have http://www.codehaus.org/maven
  +     *  to
  +     * http_www_codehaus_org_maven.properties
  +     *
  +     *
  +     * @param url
  +     * @param basedir
  +     * @return
  +     * @todo many diry tricks and replaceAll method was used (jdk 1.4 only)
  +     */
       protected String getAuthenticationInfoFile( final String url, final String basedir )
       {
  +
           String filename = url.replace( '/', '_' );
           filename = filename.replace( ':', '_' );
           filename = filename.replaceAll( "__", "_" );
           filename = filename.replaceAll( "__", "_" );
           filename = filename.replace( '.', '_' );
  -        String retValue;
  +        final String retValue;
           if ( !basedir.endsWith( File.separator ) )
           {
               retValue = basedir + File.separator + filename + ".properties";
  
  
  
  1.1                  maven-wagon/wagon-plexus-bindings/src/test/java/org/apache/maven/wagon/plexus/PlexusWagonManagerTest.java
  
  Index: PlexusWagonManagerTest.java
  ===================================================================
  package org.apache.maven.wagon.plexus;
  
  /*
   * ====================================================================
   *  The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation. All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met: 1.
   * Redistributions of source code must retain the above copyright notice, this
   * list of conditions and the following disclaimer. 2. Redistributions in
   * binary form must reproduce the above copyright notice, this list of
   * conditions and the following disclaimer in the documentation and/or other
   * materials provided with the distribution. 3. The end-userName documentation
   * included with the redistribution, if any, must include the following
   * acknowledgment: "This product includes software developed by the Apache
   * Software Foundation (http://www.apache.org/)." Alternately, this
   * acknowledgment may appear in the software itself, if and wherever such
   * third-party acknowledgments normally appear. 4. The names "Apache" and
   * "Apache Software Foundation" and "Apache Maven" must not be used to endorse
   * or promote products derived from this software without prior written
   * permission. For written permission, please contact apache@apache.org. 5.
   * Products derived from this software may not be called "Apache", "Apache
   * Maven", nor may "Apache" appear in their name, without prior written
   * permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many individuals
   * on behalf of the Apache Software Foundation. For more information on the
   * Apache Software Foundation, please see <http://www.apache.org/> .
   *
   * ====================================================================
   */
  
  import org.apache.maven.wagon.Repository;
  import org.apache.maven.wagon.UnsupportedProtocolException;
  import org.apache.maven.wagon.Wagon;
  import org.apache.maven.wagon.events.Debug;
  import org.apache.maven.wagon.managers.WagonManager;
  import org.apache.maven.wagon.providers.file.FileWagon;
  import org.apache.maven.wagon.providers.ftp.FtpWagon;
  import org.apache.maven.wagon.providers.http.HttpWagon;
  import org.apache.maven.wagon.providers.ssh.SFtpWagon;
  import org.apache.maven.wagon.providers.ssh.ScpWagon;
  import org.apache.maven.wagon.request.GetRequest;
  import org.apache.maven.wagon.result.ByteArrayResult;
  import org.codehaus.plexus.PlexusTestCase;
  
  import java.io.File;
  
  public class PlexusWagonManagerTest extends PlexusTestCase
  {
      private WagonManager wagonManager;
  
      public PlexusWagonManagerTest( String name )
      {
          super( name );
  
      }
  
  
      protected void setUp() throws Exception
      {
          super.setUp();
          wagonManager = ( WagonManager ) lookup( WagonManager.ROLE );
      }
  
      public void testWagonManager()
      {
          try
          {
              Wagon wagon = wagonManager.getWagon( "http" );
              assertNotNull( wagon );
              assertEquals( HttpWagon.class, wagon.getClass() );
  
              wagon = wagonManager.getWagon( "https" );
              assertNotNull( wagon );
              assertEquals( HttpWagon.class, wagon.getClass() );
  
  
              wagon = wagonManager.getWagon( "ftp" );
              assertNotNull( wagon );
              assertEquals( FtpWagon.class, wagon.getClass() );
  
  
              wagon = wagonManager.getWagon( "file" );
              assertNotNull( wagon );
              assertEquals( FileWagon.class, wagon.getClass() );
  
              wagon = wagonManager.getWagon( "scp" );
              assertNotNull( wagon );
              assertEquals( ScpWagon.class, wagon.getClass() );
  
  
              wagon = wagonManager.getWagon( "sftp" );
              assertNotNull( wagon );
              assertEquals( SFtpWagon.class, wagon.getClass() );
  
          }
          catch ( UnsupportedProtocolException e )
          {
              e.printStackTrace();
              fail( "Could not lookup Wagon: " + e.getMessage() );
          }
  
      }
  
      public void testGet()
      {
          //just try to fetch something from IBIBLIO
          final Repository repository = new Repository( "http", "www.ibiblio.org", 80, "maven" );
          try
          {
              Wagon wagon = wagonManager.getWagon( repository.getProtocol() );
              wagon.addTransferListener( new Debug() );
  
              final ByteArrayResult result = new ByteArrayResult();
              GetRequest request = new GetRequest( "asm/jars/asm-1.4.1.jar.md5", result );
              wagon.connect( repository );
              wagon.transfer( request );
              wagon.close();
  
              assertNotNull( result.getByteArray() );
              final String md5 = new String( result.getByteArray() );
  
              assertEquals( "534aaa0558a03c95c459991b57da93fb", md5.trim() );
  
              // try to fetch to file
  
              final File dir = new File( System.getProperty( "basedir", "target/test-output" ) );
              dir.mkdirs();
  
              File file = new File( dir, "asm-1.4.1.jar" );
              request = new GetRequest( "asm/jars/asm-1.4.1.jar",  file );
              wagon.connect( repository );
              wagon.transfer( request );
              wagon.close();
              assertTrue( file.exists() );
              assertEquals( 25822, file.length() );
  
  
          }
          catch ( Exception e )
          {
              e.printStackTrace();
              fail( e.getMessage() );
          }
  
  
      }
  
  }
  
  
  
  1.1                  maven-wagon/wagon-plexus-bindings/src/test/java/org/apache/maven/wagon/plexus/PlexusWagonManagerTest.xml
  
  Index: PlexusWagonManagerTest.xml
  ===================================================================
  <plexus>
      <components>
          <component>
              <role>org.apache.maven.wagon.managers.WagonManager</role>
              <implementation>org.apache.maven.wagon.plexus.PlexusWagonManager</implementation>
              <requirements>
                  <requirement>
                      <role>org.apache.maven.wagon.WagonFactory</role>
                      <fieldName>wagonFactories</fieldName>
                  </requirement>
              </requirements>
              <configuration/>
          </component>
  
  
          <component>
              <role>org.apache.maven.wagon.WagonFactory</role>
              <role-hint>file</role-hint>
              <implementation>org.apache.maven.wagon.providers.file.FileWagonFactory</implementation>
              <configuration/>
          </component>
  
  
          <component>
              <role>org.apache.maven.wagon.WagonFactory</role>
              <role-hint>ftp</role-hint>
              <implementation>org.apache.maven.wagon.providers.ftp.FtpWagonFactory</implementation>
              <configuration/>
          </component>
  
          <component>
              <role>org.apache.maven.wagon.WagonFactory</role>
              <role-hint>http</role-hint>
              <implementation>org.apache.maven.wagon.providers.http.HttpWagonFactory</implementation>
              <configuration/>
          </component>
  
          <component>
              <role>org.apache.maven.wagon.WagonFactory</role>
              <role-hint>ssh</role-hint>
              <implementation>org.apache.maven.wagon.providers.ssh.SshWagonFactory</implementation>
              <configuration/>
          </component>
  
  
      </components>
  </plexus>
  
  
  
  1.8       +2 -2      maven-wagon/wagon-providers/ftp/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/ftp/project.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- project.xml	10 Dec 2003 18:57:21 -0000	1.7
  +++ project.xml	8 Feb 2004 19:44:13 -0000	1.8
  @@ -3,7 +3,7 @@
   <project>
       <pomVersion>3</pomVersion>
       <id>wagon-ftp-provider</id>
  -    <groupId>wagon</groupId>
  +    <groupId>maven-wagon</groupId>
       <artifactId>wagon-ftp-provider</artifactId>
       <name>Wagon FTP Provider</name>
       <currentVersion>1.0-beta-1</currentVersion>
  @@ -57,7 +57,7 @@
   
       <dependencies>
           <dependency>
  -            <groupId>wagon</groupId>
  +            <groupId>maven-wagon</groupId>
               <artifactId>wagon-api</artifactId>
               <version>1.0-beta-1</version>
           </dependency>
  
  
  
  1.9       +2 -2      maven-wagon/wagon-providers/file/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-providers/file/project.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- project.xml	10 Dec 2003 18:57:20 -0000	1.8
  +++ project.xml	8 Feb 2004 19:44:13 -0000	1.9
  @@ -3,7 +3,7 @@
   <project>
       <pomVersion>3</pomVersion>
       <id>wagon-file-provider</id>
  -    <groupId>wagon</groupId>
  +    <groupId>maven-wagon</groupId>
       <artifactId>wagon-file-provider</artifactId>
       <type>jar</type>
       <name>Wagon File provider</name>
  @@ -53,7 +53,7 @@
       <dependencies>
   
           <dependency>
  -            <groupId>wagon</groupId>
  +            <groupId>maven-wagon</groupId>
               <artifactId>wagon-api</artifactId>
               <version>1.0-beta-1</version>
               <type>jar</type>
  
  
  
  1.1                  maven-wagon/wagon-plexus-bindings/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  *.log
  target
  .classpath
  .project
  default.lst
  test.out
  default.ajsym
  *.iml
  *.ipr
  *.iws
  
  
  
  1.1                  maven-wagon/wagon-plexus-bindings/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <project>
      <pomVersion>3</pomVersion>
      <id>wagon-plexus-bindings</id>
      <groupId>wagon</groupId>
      <artifactId>wagon-plexus-bindings</artifactId>
      <type>jar</type>
      <currentVersion>1.0-SNAPSHOT</currentVersion>
      <name>Wagon Plexus Bindings</name>
      <organization>
          <name>Apache Software Foundation</name>
          <url>http://www.apache.org/</url>
          <logo>http://maven.apache.org/images/apache-maven-project.png</logo>
      </organization>
  
      <description></description>
      <shortDescription>Wagon Plexus bindings</shortDescription>
      <description>
          
      </description>
      <package>org.apache.maven.wagon</package>
      <inceptionYear>2004</inceptionYear>
      <url>http://maven.apache.org/wagon/wagon-plexus-bindings</url>
      <issueTrackingUrl>http://jira.codehaus.org/BrowseProject.jspa?id=10319</issueTrackingUrl>
      <repository>
          <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:maven-wagon/wagon-api</connection>
          <url>http://cvs.apache.org/viewcvs/maven-wagon/wagon-api/</url>
      </repository>
  
      <versions>
          <version>
              <id>beta-1</id>
              <name>1.0-beta-1</name>
              <tag>HEAD</tag>
          </version>
      </versions>
  
  
      <developers>
          <developer>
              <name>Michal Maczka</name>
              <id>michal</id>
              <email>michal@dimatics.com</email>
              <organization>Dimatics</organization>
              <roles>
                  <role>Architect</role>
              </roles>
          </developer>
      </developers>
  
      <licenses>
          <license>
              <name>The Apache Software License, Version 1.1</name>
              <url>http://cvs.apache.org/viewcvs.cgi/*checkout*/maven/LICENSE.txt</url>
              <distribution>repo</distribution>
          </license>
      </licenses>
  
  
      <dependencies>
  
          <dependency>
              <groupId>maven-wagon</groupId>
              <artifactId>wagon-api</artifactId>
              <version>1.0-beta-1</version>
              <type>jar</type>
          </dependency>
  
          <!-- File -->
          <dependency>
              <groupId>maven-wagon</groupId>
              <artifactId>wagon-file-provider</artifactId>
              <version>1.0-beta-1</version>
              <type>jar</type>
          </dependency>
  
  
          <dependency>
              <groupId>commons-net</groupId>
              <artifactId>commons-net</artifactId>
              <version>1.0.0</version>
              <type>jar</type>
          </dependency>
  
          <!-- FTP -->
          <dependency>
              <groupId>maven-wagon</groupId>
              <artifactId>wagon-ftp-provider</artifactId>
              <version>1.0-beta-1</version>
              <type>jar</type>
          </dependency>
  
  
          <dependency>
              <groupId>commons-net</groupId>
              <artifactId>commons-net</artifactId>
              <version>1.0.0</version>
              <type>jar</type>
          </dependency>
  
  
          <!-- HTTP -->
          <dependency>
              <groupId>maven-wagon</groupId>
              <artifactId>wagon-http-provider</artifactId>
              <version>1.0-beta-1</version>
              <type>jar</type>
          </dependency>
  
          <dependency>
              <groupId>commons-httpclient</groupId>
              <artifactId>commons-httpclient</artifactId>
              <version>2.0-rc2</version>
              <type>jar</type>
          </dependency>
  
          <dependency>
              <groupId>commons-logging</groupId>
              <artifactId>commons-logging</artifactId>
              <version>1.0.3</version>
              <type>jar</type>
          </dependency>
  
          <dependency>
              <groupId>commons-lang</groupId>
              <artifactId>commons-lang</artifactId>
              <version>1.0.1</version>
              <type>jar</type>
          </dependency>
  
  
          <!-- SSH -->
          <dependency>
              <groupId>maven-wagon</groupId>
              <artifactId>wagon-ssh-provider</artifactId>
              <version>1.0-beta-1</version>
              <type>jar</type>
          </dependency>
  
          <dependency>
              <groupId>jsch</groupId>
              <artifactId>jsch</artifactId>
              <version>0.1.8</version>
              <type>jar</type>
          </dependency>
  
          <!-- Plexus -->
  
          <dependency>
              <groupId>xpp3</groupId>
              <artifactId>xpp3</artifactId>
              <version>1.1.3.3</version>
              <type>jar</type>
          </dependency>
  
          <dependency>
              <groupId>plexus</groupId>
              <artifactId>plexus</artifactId>
              <version>0.14-SNAPSHOT</version>
              <type>jar</type>
          </dependency>
  
  
          <dependency>
              <groupId>classworlds</groupId>
              <artifactId>classworlds</artifactId>
              <version>1.1-SNAPSHOT</version>
              <type>jar</type>
          </dependency>
  
          <dependency>
              <groupId>xstream</groupId>
              <artifactId>xstream</artifactId>
              <version>0.4</version>
              <type>jar</type>
          </dependency>
  
      </dependencies>
  
      <build>
  
          <sourceDirectory>src/main/java</sourceDirectory>
          <unitTestSourceDirectory>src/test/java</unitTestSourceDirectory>
          <unitTest>
              <includes>
                  <include>**/*Test.java</include>
              </includes>
          </unitTest>
  
          <resources>
              <resource>
                  <directory>src/main/resources</directory>
              </resource>
          </resources>
  
  
      </build>
  
  
      <reports>
          <report>maven-jdepend-plugin</report>
          <report>maven-checkstyle-plugin</report>
          <report>maven-changes-plugin</report>
          <report>maven-changelog-plugin</report>
          <report>maven-file-activity-plugin</report>
          <report>maven-developer-activity-plugin</report>
          <report>maven-javadoc-plugin</report>
          <report>maven-jxr-plugin</report>
          <report>maven-junit-report-plugin</report>
          <report>maven-tasklist-plugin</report>
          <report>maven-pmd-plugin</report>
          <report>maven-simian-plugin</report>
          <report>maven-clover-plugin</report>
      </reports>
  
  </project>
  
  
  
  1.1                  maven-wagon/wagon-plexus-bindings/src/main/resources/META-INF/plexus/components.xml
  
  Index: components.xml
  ===================================================================
  <components>
      <component>
          <role>org.apache.maven.wagon.managers.WagonManager</role>
          <implementation>org.apache.maven.wagon.plexus.PlexusWagonManager</implementation>
          <requirements>
              <requirement>
                  <role>org.apache.maven.wagon.WagonFactory</role>
                  <fieldName>wagonFactories</fieldName>
              </requirement>
          </requirements>
          <configuration/>
      </component>
  
  
      <component>
          <role>org.apache.maven.wagon.WagonFactory</role>
          <role-hint>file</role-hint>
          <implementation>org.apache.maven.wagon.providers.file.FileWagonFactory</implementation>
      </component>
  
  
      <component>
          <role>org.apache.maven.wagon.WagonFactory</role>
          <role-hint>ftp</role-hint>
          <implementation>org.apache.maven.wagon.providers.ftp.FtpWagonFactory</implementation>
      </component>
      <component>
          <role>org.apache.maven.wagon.WagonFactory</role>
          <role-hint>http</role-hint>
          <implementation>org.apache.maven.wagon.providers.http.HttpWagonFactory</implementation>
      </component>
  
      <component>
          <role>org.apache.maven.wagon.WagonFactory</role>
          <role-hint>ssh</role-hint>
          <implementation>org.apache.maven.wagon.providers.ssh.SshWagonFactory</implementation>
      </component>
  
      <component>
  
          
      </component>
  
  </components>
  
  
  
  1.2       +3 -1      maven-wagon/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/maven-wagon/project.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.properties	6 Dec 2003 19:43:13 -0000	1.1
  +++ project.properties	8 Feb 2004 19:44:13 -0000	1.2
  @@ -1 +1,3 @@
  -maven.multiproject.includes=wagon-api/project.xml,wagon-providers/file/project.xml,wagon-providers/http/project.xml,wagon-providers/ftp/project.xml,wagon-providers/ssh/project.xml,wagon-maven-bindings/project.xml
  +maven.multiproject.includes=wagon-api/project.xml,wagon-providers/file/project.xml,wagon-providers/http/project.xml,wagon-providers/ftp/project.xml,wagon-providers/ssh/project.xml,wagon-plexus-bindings/project.xml
  +maven.idea.project.multiproject.includes=wagon-api/project.xml,wagon-providers/file/project.xml,wagon-providers/http/project.xml,wagon-providers/ftp/project.xml,wagon-providers/ssh/project.xml,wagon-maven-bindings/project.xml
  +maven.idea.project.multiproject.basedir=.
  \ No newline at end of file
  
  
  
  1.11      +1 -1      maven-wagon/wagon-api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/project.xml,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- project.xml	10 Dec 2003 18:45:00 -0000	1.10
  +++ project.xml	8 Feb 2004 19:44:13 -0000	1.11
  @@ -3,7 +3,7 @@
   <project>
       <pomVersion>3</pomVersion>
       <id>wagon-api</id>
  -    <groupId>wagon</groupId>
  +    <groupId>maven-wagon</groupId>
       <artifactId>wagon-api</artifactId>
       <type>jar</type>
       <name>Wagon API</name>
  
  
  
  1.9       +34 -14    maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/result/ByteArrayResult.java
  
  Index: ByteArrayResult.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/result/ByteArrayResult.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ByteArrayResult.java	6 Dec 2003 05:35:47 -0000	1.8
  +++ ByteArrayResult.java	8 Feb 2004 19:44:13 -0000	1.9
  @@ -56,26 +56,20 @@
    * @author Peter Donald
    * @version $Id$
    */
  -public class ByteArrayResult
  -    extends StreamResult
  +public class ByteArrayResult  implements WagonResult
  +
   {
  +     private ByteArrayOutputStream  outputStream = new ByteArrayOutputStream();
  +     private boolean closed;
  +
       /**
        * Create instance of result.
        */
       public ByteArrayResult()
       {
  -        super( null, true );
       }
   
       /**
  -     * Create new ByteArrayOutputStream.
  -     *
  -     * @return the ByteArrayOutputStream
  -     */
  -    protected OutputStream createOutputStream()
  -    {
  -        return new ByteArrayOutputStream();
  -    }
   
       /**
        * Return the byte array for result.
  @@ -85,7 +79,33 @@
       public byte[] getByteArray()
           throws IOException
       {
  -        final ByteArrayOutputStream stream = (ByteArrayOutputStream)getOutputStream();
  -        return stream.toByteArray();
  +        return outputStream.toByteArray();
  +    }
  +
  +    public OutputStream getOutputStream() throws IOException
  +    {
  +        if ( closed)
  +        {
  +            return null;
  +        }
  +        return outputStream;
  +    }
  +
  +    public void close()
  +    {
  +        try
  +        {
  +            outputStream.close();
  +            closed = true;
  +        }
  +        catch ( IOException e )
  +        {
  +
  +        }
  +    }
  +
  +    public boolean isClosed()
  +    {
  +        return closed;
       }
   }
  
  
  

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