maven-wagon-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r165261 - in /maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon: AbstractWagon.java PathUtils.java
Date Fri, 29 Apr 2005 04:50:40 GMT
Author: brett
Date: Thu Apr 28 21:50:40 2005
New Revision: 165261

URL: http://svn.apache.org/viewcvs?rev=165261&view=rev
Log:
required addition to the core for SCM based wagon

Modified:
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
    maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
URL: http://svn.apache.org/viewcvs/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java?rev=165261&r1=165260&r2=165261&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
(original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java
Thu Apr 28 21:50:40 2005
@@ -515,4 +515,37 @@
     {
         this.transferEventSupport = transferEventSupport;
     }
+
+    /**
+     * This method is used if you are not streaming the transfer, to make sure any listeners
dependent on state
+     * (eg checksum observers) succeed.
+     */
+    protected void postProcessListeners( Resource resource, File source, int requestType
)
+        throws TransferFailedException
+    {
+        byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
+
+        TransferEvent transferEvent = new TransferEvent( this, resource, TransferEvent.TRANSFER_PROGRESS,
requestType );
+
+        try
+        {
+            InputStream input = new FileInputStream( source );
+
+            while ( true )
+            {
+                int n = input.read( buffer );
+
+                if ( n == -1 )
+                {
+                    break;
+                }
+
+                fireTransferProgress( transferEvent, buffer, n );
+            }
+        }
+        catch ( IOException e )
+        {
+            throw new TransferFailedException( "Failed to post-process the source file",
e );
+        }
+    }
 }

Modified: maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java
URL: http://svn.apache.org/viewcvs/maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java?rev=165261&r1=165260&r2=165261&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java
(original)
+++ maven/wagon/trunk/wagon-provider-api/src/main/java/org/apache/maven/wagon/PathUtils.java
Thu Apr 28 21:50:40 2005
@@ -239,6 +239,11 @@
             url = url.substring( url.indexOf( ":", 4 ) + 1 ).trim();
         }
 
+        if ( url.startsWith( "file:" ) || url.startsWith( "local:" ) )
+        {
+            return WagonConstants.UNKNOWN_PORT;
+        }
+
         // skip over protocol
         url = url.substring( url.indexOf( ":" ) + 1 ).trim();
         if ( url.startsWith( "//" ) )



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