Author: niclas
Date: Sat May 22 11:55:28 2004
New Revision: 20221

Modified:
   avalon/trunk/tools/magic/artifact/src/dist/build.bsh
   avalon/trunk/tools/magic/java/src/dist/build.bsh
Log:
Cleaning up some code from System.out

Modified: avalon/trunk/tools/magic/artifact/src/dist/build.bsh
==============================================================================
--- avalon/trunk/tools/magic/artifact/src/dist/build.bsh        (original)
+++ avalon/trunk/tools/magic/artifact/src/dist/build.bsh        Sat May 22 
11:55:28 2004
@@ -164,9 +164,11 @@
         BufferedOutputStream bos = null;
         InputStream in = null;
         BufferedInputStream bis = null;
+        File dlFile = File.createTempFile( "~magic", ".tmp", 
dest.getParentFile() );
+        dlFile.deleteOnExit();
         try
         {
-            out = new FileOutputStream( dest );
+            out = new FileOutputStream( dlFile );
             bos = new BufferedOutputStream( out );
             URL url = toRemoteURL( artifact );
             URLConnection conn = url.openConnection();
@@ -174,10 +176,19 @@
             in = conn.getInputStream();
             bis = new BufferedInputStream( in );
             int b;
+            int counter = 0;
             while( ( b = bis.read() ) != -1 )
             {
+                counter++;
+                if( counter > 1000 )
+                {
+                    counter = 0;
+                    System.out.print( "." );
+                }
                 bos.write( b );
             }
+            System.out.println( "\nDownloaded: " + counter + " bytes." );
+            dlFile.renameTo( dest );            
         } finally
         {
             if( out != null )
@@ -188,6 +199,7 @@
                 in.close();
             if( bis != null )
                 bis.close();
+            dlFile.delete();
         }
     }
     

Modified: avalon/trunk/tools/magic/java/src/dist/build.bsh
==============================================================================
--- avalon/trunk/tools/magic/java/src/dist/build.bsh    (original)
+++ avalon/trunk/tools/magic/java/src/dist/build.bsh    Sat May 22 11:55:28 2004
@@ -84,6 +84,9 @@
         Path depPath = ap.getClassPath( deps );
         cp.add( depPath );
         
+        if( getLogger().isDebugEnabled() )
+            getLogger().debug( "Resolved Dependencies: " + cp.toString() );    
    
+        
         /* Add the source path */
         Path src = javac.createSrc();
         Path.PathElement srcPE = src.createPathElement();

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to