Return-Path: Delivered-To: apmail-maven-wagon-cvs-archive@www.apache.org Received: (qmail 75478 invoked from network); 29 Jun 2004 18:44:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 29 Jun 2004 18:44:47 -0000 Received: (qmail 42571 invoked by uid 500); 29 Jun 2004 18:42:42 -0000 Delivered-To: apmail-maven-wagon-cvs-archive@maven.apache.org Received: (qmail 42459 invoked by uid 500); 29 Jun 2004 18:42:41 -0000 Mailing-List: contact wagon-cvs-help@maven.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list wagon-cvs@maven.apache.org Received: (qmail 42346 invoked by uid 99); 29 Jun 2004 18:42:40 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Tue, 29 Jun 2004 11:42:40 -0700 Received: (qmail 57786 invoked by uid 1668); 29 Jun 2004 18:14:28 -0000 Date: 29 Jun 2004 18:14:28 -0000 Message-ID: <20040629181428.57785.qmail@minotaur.apache.org> From: michal@apache.org To: maven-wagon-cvs@apache.org Subject: cvs commit: maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon AbstractWagon.java PathUtils.java WagonTestCase.java WagonUtils.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N michal 2004/06/29 11:14:28 Modified: wagon-api/src/main/java/org/apache/maven/wagon/providers/file FileWagon.java wagon-api/src/main/java/org/apache/maven/wagon AbstractWagon.java PathUtils.java WagonTestCase.java WagonUtils.java Log: formatting and minor fixes Revision Changes Path 1.8 +1 -2 maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java Index: FileWagon.java =================================================================== RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/providers/file/FileWagon.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- FileWagon.java 19 Jun 2004 14:16:21 -0000 1.7 +++ FileWagon.java 29 Jun 2004 18:14:27 -0000 1.8 @@ -80,7 +80,6 @@ } } - return new LazyFileOutputStream( f ); 1.7 +3 -3 maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java Index: AbstractWagon.java =================================================================== RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/AbstractWagon.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- AbstractWagon.java 25 Jun 2004 17:20:13 -0000 1.6 +++ AbstractWagon.java 29 Jun 2004 18:14:28 -0000 1.7 @@ -96,7 +96,7 @@ // Stream i/o // ---------------------------------------------------------------------- - protected void getTransfer(String resource, File destination, InputStream input, OutputStream output) + protected void getTransfer( String resource, File destination, InputStream input, OutputStream output ) throws TransferFailedException { fireGetStarted( resource, destination ); @@ -136,7 +136,7 @@ fireGetCompleted( resource, destination ); } - protected void putTransfer(String resource, File source, InputStream input, OutputStream output, boolean closeOutput) + protected void putTransfer(String resource, File source, InputStream input, OutputStream output, boolean closeOutput ) throws TransferFailedException { firePutStarted( resource, source ); 1.3 +29 -1 maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/PathUtils.java Index: PathUtils.java =================================================================== RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/PathUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PathUtils.java 3 Jun 2004 18:27:00 -0000 1.2 +++ PathUtils.java 29 Jun 2004 18:14:28 -0000 1.3 @@ -64,6 +64,7 @@ final int max ) { final StringTokenizer tok; + if ( separator == null ) { // Null separator means we're using StringTokenizer's default @@ -76,15 +77,19 @@ } int listSize = tok.countTokens(); + if ( max > 0 && listSize > max ) { listSize = max; } final String[] list = new String[listSize]; + int i = 0; + int lastTokenBegin; int lastTokenEnd = 0; + while ( tok.hasMoreTokens() ) { if ( max > 0 && i == listSize - 1 ) @@ -93,16 +98,23 @@ // tokens left over in our input, the last list // element gets all remaining text. final String endToken = tok.nextToken(); + lastTokenBegin = str.indexOf( endToken, lastTokenEnd ); + list[i] = str.substring( lastTokenBegin ); + break; + } else { list[i] = tok.nextToken(); + lastTokenBegin = str.indexOf( list[i], lastTokenEnd ); + lastTokenEnd = lastTokenBegin + list[i].length(); } + i++; } return list; @@ -124,18 +136,23 @@ } final String protocol = PathUtils.protocol( url ); + if ( protocol == null || protocol.equals( "file" ) ) { return ""; } + String host = url.substring( url.indexOf( "://" ) + 3 ).trim(); int pos = host.indexOf( "/" ); + if ( pos > 0 ) { host = host.substring( 0, pos ); } + pos = host.indexOf( ":" ); + if ( pos > 0 ) { host = host.substring( 0, pos ); @@ -158,6 +175,7 @@ { final int pos = url.indexOf( "://" ); + if ( pos == -1 ) { return ""; @@ -174,26 +192,31 @@ { final String protocol = PathUtils.protocol( url ); + if ( protocol == null || protocol.equals( "file" ) ) { return WagonConstants.UNKNOWN_PORT; } final String host = PathUtils.host( url ); + if ( host == null ) { return WagonConstants.UNKNOWN_PORT; } final String prefix = protocol + "://" + host; + final int start = prefix.length(); if ( url.length() > start && url.charAt( start ) == ':' ) { int end = url.indexOf( '/', start ); + if ( end == -1 ) { end = url.length(); } + return Integer.parseInt( url.substring( start + 1, end ) ); } else @@ -211,7 +234,9 @@ public static String basedir( final String url ) { final String protocol = PathUtils.protocol( url ); + String retValue = null; + if ( protocol.equals( "file" ) ) { retValue = url.substring( protocol.length() + 3 ); @@ -219,8 +244,11 @@ else { final String host = PathUtils.host( url ); + final int port = PathUtils.port( url ); + final int pos; + if ( port != WagonConstants.UNKNOWN_PORT ) { pos = ( protocol + "://" + host + ":" + port + "/" ).length(); 1.11 +2 -2 maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonTestCase.java Index: WagonTestCase.java =================================================================== RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonTestCase.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- WagonTestCase.java 20 Jun 2004 15:25:28 -0000 1.10 +++ WagonTestCase.java 29 Jun 2004 18:14:28 -0000 1.11 @@ -200,7 +200,7 @@ protected void putFile() throws Exception { - message( "Putting test artifact into test repository " + testRepository ); + message( "Putting test artifact: " + resource + " into test repository " + testRepository ); Wagon wagon = getWagon(); 1.5 +2 -9 maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonUtils.java Index: WagonUtils.java =================================================================== RCS file: /home/cvs/maven-wagon/wagon-api/src/main/java/org/apache/maven/wagon/WagonUtils.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- WagonUtils.java 19 Jun 2004 14:16:21 -0000 1.4 +++ WagonUtils.java 29 Jun 2004 18:14:28 -0000 1.5 @@ -115,13 +115,9 @@ while ( !queue.isEmpty() ) { - String path = ( String ) queue.removeFirst(); - - File currentDir = new File ( dir, path); - - System.out.println( "Processing dir: " + currentDir ); + File currentDir = new File ( dir, path ); File[] files = currentDir.listFiles(); @@ -129,8 +125,6 @@ { File file = files[i]; - System.out.println( "Processing file: " + file ); - String resource; if ( path.length() > 0 ) @@ -140,7 +134,6 @@ else { resource = file.getName(); - } if ( file.isDirectory() ) --------------------------------------------------------------------- To unsubscribe, e-mail: wagon-cvs-unsubscribe@maven.apache.org For additional commands, e-mail: wagon-cvs-help@maven.apache.org