You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2012/02/24 12:25:05 UTC

svn commit: r1293183 - /openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java

Author: rmannibucau
Date: Fri Feb 24 11:25:05 2012
New Revision: 1293183

URL: http://svn.apache.org/viewvc?rev=1293183&view=rev
Log:
buferrinf is and os in copyLib method

Modified:
    openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java

Modified: openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
URL: http://svn.apache.org/viewvc/openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java?rev=1293183&r1=1293182&r2=1293183&view=diff
==============================================================================
--- openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java (original)
+++ openejb/trunk/maven-plugins/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java Fri Feb 24 11:25:05 2012
@@ -27,6 +27,8 @@ import org.apache.maven.plugin.MojoExecu
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.openejb.config.RemoteServer;
 
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -213,8 +215,8 @@ public abstract class AbstractTomEEMojo 
     }
 
     private void copyLib(final String lib, final File destParent, final String defaultType) {
-        FileInputStream is = null;
-        FileOutputStream os = null;
+        InputStream is = null;
+        OutputStream os = null;
         final String[] infos = lib.split(":");
         final String classifier;
         final String type;
@@ -236,8 +238,8 @@ public abstract class AbstractTomEEMojo 
             final Artifact artifact = factory.createDependencyArtifact(infos[0], infos[1], createFromVersion(infos[2]), type, classifier, SCOPE_COMPILE);
             resolver.resolve(artifact, remoteRepos, local);
             final File file = artifact.getFile();
-            is = new FileInputStream(file);
-            os = new FileOutputStream(new File(destParent, file.getName()));
+            is = new BufferedInputStream(new FileInputStream(file));
+            os = new BufferedOutputStream(new FileOutputStream(new File(destParent, file.getName())));
             copy(is, os);
         } catch (Exception e) {
             getLog().error(e.getMessage(), e);