maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-wagon/wagon-api/xdocs index.xml
Date Wed, 21 Apr 2004 02:49:39 GMT
jvanzyl     2004/04/20 19:49:39

  Modified:    wagon-api/src/main/java/org/apache/maven/wagon/manager
                        DefaultWagonManager.java WagonManager.java
               wagon-api/xdocs index.xml
  Log:
  
  
  Revision  Changes    Path
  1.2       +19 -51    maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java
  
  Index: DefaultWagonManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/manager/DefaultWagonManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultWagonManager.java	30 Mar 2004 14:43:02 -0000	1.1
  +++ DefaultWagonManager.java	21 Apr 2004 02:49:39 -0000	1.2
  @@ -16,12 +16,9 @@
    * limitations under the License.
    */
   
  -import org.apache.maven.wagon.ResourceDoesNotExistException;
  -import org.apache.maven.wagon.TransferFailedException;
   import org.apache.maven.wagon.UnsupportedProtocolException;
   import org.apache.maven.wagon.Wagon;
   import org.apache.maven.wagon.artifact.Artifact;
  -import org.apache.maven.wagon.authorization.AuthorizationException;
   import org.apache.maven.wagon.repository.Repository;
   import org.codehaus.plexus.PlexusConstants;
   import org.codehaus.plexus.PlexusContainer;
  @@ -31,6 +28,7 @@
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
   
   import java.io.File;
  +import java.util.Iterator;
   import java.util.List;
   
   
  @@ -63,55 +61,30 @@
           return wagon;
       }
   
  -    public boolean add( Repository repository )
  +    public void addRepository( Repository repository )
       {
  -        return repositories.add( repository );
  +        repositories.add( repository );
       }
   
  -    public boolean remove( Repository repository )
  +    public void removeRepository( Repository repository )
       {
  -        return repositories.remove( repository );
  +        repositories.remove( repository );
       }
   
  -    public void get( Artifact artifact, Repository source, Repository destination )
  -        throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException,
UnsupportedProtocolException
  -    {
  -        String sourceProtocol = source.getProtocol();
  -
  -        Wagon sourceWagon = getWagon( sourceProtocol );
  -
  -        String destinationProtocol = destination.getProtocol();
  -
  -        Wagon destinationWagon = getWagon( destinationProtocol );
  -    }
  -
  -
  -    /*
  -    public void putToAll(  File file,  String resource,  TransferListener transferListener,
 SessionListener sessionListener )
  +    public void put( File source, Artifact artifact )
  +        throws Exception
       {
           for ( Iterator iter = repositories.iterator(); iter.hasNext(); )
           {
  -             Repository repository = ( Repository ) iter.next();
  +            Repository repository = (Repository) iter.next();
   
               try
               {
  -                 Wagon wagon = getWagon( repository.getProtocol() );
  -
  -                if ( sessionListener != null )
  -                {
  -                    wagon.addSessionListener( sessionListener );
  -                }
  -
  -                if ( transferListener != null )
  -                {
  -                    wagon.addTransferListener( transferListener );
  -                }
  +                Wagon wagon = getWagon( repository.getProtocol() );
   
                   wagon.connect( repository );
   
  -                 PutRequest putRequest = new PutRequest( file, resource );
  -
  -                wagon.transfer( putRequest );
  +                wagon.put( source, artifact );
               }
               catch ( UnsupportedProtocolException e )
               {
  @@ -124,28 +97,25 @@
               }
           }
       }
  -    */
   
  -    /*
  -    public boolean getFromAny( File file, String resource, TransferListener transferListener,
SessionListener sessionListener )
  +    public boolean get( Artifact artifact, File destination )
  +        throws Exception
       {
  -         File temp = new File( file.getAbsolutePath() + ".tmp" );
  -
           boolean transfered = false;
   
  +        File temp = File.createTempFile( "wagon", "tmp" );
  +
           for ( Iterator iter = repositories.iterator(); iter.hasNext(); )
           {
  -             Repository repository = ( Repository ) iter.next();
  +            Repository repository = (Repository) iter.next();
   
               try
               {
  -                 Wagon wagon = getWagon( repository.getProtocol() );
  +                Wagon wagon = getWagon( repository.getProtocol() );
   
                   wagon.connect( repository );
   
  -                 GetRequest getRequest = new GetRequest( resource, temp );
  -
  -                wagon.transfer( getRequest );
  +                wagon.get( artifact, temp );
   
                   transfered = true;
               }
  @@ -159,7 +129,7 @@
   
           if ( transfered )
           {
  -            temp.renameTo( file );
  +            temp.renameTo( destination );
           }
   
           temp.delete();
  @@ -172,12 +142,10 @@
           return repositories;
   
       }
  -    */
   
       public void contextualize( Context context )
           throws ContextException
       {
           container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
       }
  -
   }
  
  
  
  1.2       +4 -0      maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/manager/WagonManager.java
  
  Index: WagonManager.java
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/manager/WagonManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WagonManager.java	30 Mar 2004 14:43:02 -0000	1.1
  +++ WagonManager.java	21 Apr 2004 02:49:39 -0000	1.2
  @@ -33,4 +33,8 @@
   
      Wagon getWagon( String protocol )
           throws UnsupportedProtocolException;
  +
  +    void addRepository( Repository repository );
  +
  +    void removeRepository( Repository repository );
   }
  
  
  
  1.2       +1 -0      maven-wagon/wagon-api/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/maven-wagon/wagon-api/xdocs/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml	30 Mar 2004 14:43:05 -0000	1.1
  +++ index.xml	21 Apr 2004 02:49:39 -0000	1.2
  @@ -23,3 +23,4 @@
   
       </body>
   </document>
  +
  
  
  

---------------------------------------------------------------------
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