tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1556451 - in /tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common: IO.java TomEEContainer.java
Date Wed, 08 Jan 2014 07:11:26 GMT
Author: rmannibucau
Date: Wed Jan  8 07:11:26 2014
New Revision: 1556451

URL: http://svn.apache.org/r1556451
Log:
TOMEE-1102 skip string usage when slurping file bytes

Modified:
    tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/IO.java
    tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/TomEEContainer.java

Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/IO.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/IO.java?rev=1556451&r1=1556450&r2=1556451&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/IO.java
(original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/IO.java
Wed Jan  8 07:11:26 2014
@@ -126,10 +126,14 @@ public class IO {
         return slurp(new File(fileName));
     }
 
-    public static String slurp(File file) throws IOException {
+    public static byte[] slurpBytes(File file) throws IOException {
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         copy(file, out);
-        return new String(out.toByteArray());
+        return out.toByteArray();
+    }
+
+    public static String slurp(File file) throws IOException {
+        return new String(slurpBytes(file));
     }
 
     public static String slurp(InputStream in) throws IOException {

Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/TomEEContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/TomEEContainer.java?rev=1556451&r1=1556450&r2=1556451&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/TomEEContainer.java
(original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/TomEEContainer.java
Wed Jan  8 07:11:26 2014
@@ -42,6 +42,9 @@ import org.jboss.shrinkwrap.api.asset.St
 import org.jboss.shrinkwrap.api.exporter.ZipExporter;
 import org.jboss.shrinkwrap.descriptor.api.Descriptor;
 
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
 import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
@@ -53,9 +56,6 @@ import java.util.Map;
 import java.util.Properties;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
 
 public abstract class TomEEContainer<Configuration extends TomEEConfiguration> implements
DeployableContainer<Configuration> {
     protected static final Logger LOGGER = Logger.getLogger(TomEEContainer.class.getName());
@@ -257,7 +257,7 @@ public abstract class TomEEContainer<Con
                     props.putAll(deployerProperties);
 
                     if ("true".equalsIgnoreCase(deployerProperties.getProperty(DeployerEjb.OPENEJB_USE_BINARIES,
"false"))) {
-                        final byte[] slurpBinaries = IO.slurp(file).getBytes();
+                        final byte[] slurpBinaries = IO.slurpBytes(file);
                         props.put(DeployerEjb.OPENEJB_VALUE_BINARIES, slurpBinaries);
                         props.put(DeployerEjb.OPENEJB_PATH_BINARIES, archive.getName());
                     }



Mime
View raw message