cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r410057 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/acting/CopySourceAction.java
Date Mon, 29 May 2006 08:52:44 GMT
Author: antonio
Date: Mon May 29 01:52:43 2006
New Revision: 410057

URL: http://svn.apache.org/viewvc?rev=410057&view=rev
Log:
Using SourceUtil.copy(). Thanks to Frédéric Glorieux. See COCOON-1815

Modified:
    cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/acting/CopySourceAction.java

Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/acting/CopySourceAction.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/acting/CopySourceAction.java?rev=410057&r1=410056&r2=410057&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/acting/CopySourceAction.java
(original)
+++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/acting/CopySourceAction.java
Mon May 29 01:52:43 2006
@@ -28,6 +28,7 @@
 import org.apache.excalibur.source.ModifiableSource;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
+import org.apache.excalibur.source.SourceUtil;
 import org.apache.excalibur.source.TraversableSource;
 
 /**
@@ -89,17 +90,9 @@
 
         // And transfer all content.
         try {
-            byte[] buffer = new byte[1024];
-            int len;
-            while ((len = is.read(buffer, 0, buffer.length)) > 0) {
-                os.write(buffer, 0, len);
-            }
-            os.close();
-        } catch(Exception e) {
-            if (wdest.canCancel(os)) {
-                wdest.cancel(os);
-            }
+            SourceUtil.copy(is, os);
         } finally {
+            os.close();
             is.close();
         }
         // Success !



Mime
View raw message