tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r1295357 [2/2] - in /openejb/trunk/openejb: arquillian-tomee/arquillian-tomee-common/src/main/java/org/apache/openejb/arquillian/common/ container/openejb-core/src/main/java/org/apache/openejb/assembler/ container/openejb-core/src/main/java...
Date Thu, 01 Mar 2012 00:43:39 GMT
Modified: openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatLoader.java
Thu Mar  1 00:43:35 2012
@@ -33,6 +33,7 @@ import org.apache.openejb.config.NewLoad
 import org.apache.openejb.config.sys.Tomee;
 import org.apache.openejb.core.ServerFederation;
 import org.apache.openejb.core.ThreadContext;
+import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.Loader;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.server.ServerService;
@@ -173,8 +174,7 @@ public class TomcatLoader implements Loa
         final Set<String> exclusions = new HashSet<String>(Arrays.asList(NewLoaderLogic.getExclusions()));
         final File catalinaProperties = new File(conf, "catalina.properties");
         if (catalinaProperties.exists()) {
-            final Properties catalinaProps = new Properties();
-            catalinaProps.load(new FileInputStream(catalinaProperties));
+            final Properties catalinaProps = IO.readProperties(catalinaProperties);
             final String jarToSkipProp = catalinaProps.getProperty("tomcat.util.scan.DefaultJarScanner.jarsToSkip");
             if (jarToSkipProp != null) {
                 for (String s : jarToSkipProp.split(",")) {

Modified: openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
Thu Mar  1 00:43:35 2012
@@ -62,6 +62,7 @@ import org.apache.openejb.core.WebContex
 import org.apache.openejb.core.ivm.naming.SystemComponentReference;
 import org.apache.openejb.jee.EnvEntry;
 import org.apache.openejb.jee.WebApp;
+import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.util.LinkResolver;
 import org.apache.openejb.util.LogCategory;
@@ -257,7 +258,7 @@ public class TomcatWebAppBuilder impleme
             if (war.isDirectory()) {
                 File cXml = new File(war, Constants.ApplicationContextXml);
                 if (cXml.exists()) {
-                    contextXml = new FileInputStream(cXml);
+                    contextXml = IO.read(cXml);
                     System.out.println("using context file " + cXml.getAbsolutePath());
                 }
             } else { // war

Modified: openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/common/TomcatVersion.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/common/TomcatVersion.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/common/TomcatVersion.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/common/TomcatVersion.java
Thu Mar  1 00:43:35 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.tomee.common;
 
+import org.apache.openejb.loader.IO;
+
 import java.util.Properties;
 
 /**
@@ -67,9 +69,8 @@ public enum TomcatVersion {
             // common class loader in previous versions can not see the
             // catalina.jar which contains the ServerInfo.properties
             if (serverNumber == null) {
-                Properties properties = new Properties();
-                ClassLoader classLoader = TomcatVersion.class.getClassLoader();
-                properties.load(classLoader.getResourceAsStream("org/apache/catalina/util/ServerInfo.properties"));
+                final ClassLoader classLoader = TomcatVersion.class.getClassLoader();
+                final Properties properties = IO.readProperties(classLoader.getResourceAsStream("org/apache/catalina/util/ServerInfo.properties"),
new Properties());
 
                 serverNumber = properties.getProperty("server.number");
                 if (serverNumber == null) {

Modified: openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java
Thu Mar  1 00:43:35 2012
@@ -17,18 +17,13 @@
  */
 package org.apache.tomee.installer;
 
+import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
 
 import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.FileWriter;
-import java.io.Flushable;
 import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.lang.reflect.Method;
 import java.util.LinkedList;
 import java.util.jar.JarFile;
@@ -138,7 +133,7 @@ public class Installer {
 
         try {
 
-            final ZipInputStream source = new ZipInputStream(new FileInputStream(sourceJar));
+            final ZipInputStream source = new ZipInputStream(IO.read(sourceJar));
 
             final ByteArrayOutputStream destinationBuffer = new ByteArrayOutputStream(524288);
             final ZipOutputStream destination = new ZipOutputStream(destinationBuffer);
@@ -152,50 +147,18 @@ public class Installer {
 
                 destination.putNextEntry(new ZipEntry(entryName));
 
-                copy(source, destination);
+                IO.copy(source, destination);
             }
 
-            close(source);
-            close(destination);
+            IO.close(source);
+            IO.close(destination);
 
-            writeToFile(destinationJar, destinationBuffer);
+            IO.copy(destinationBuffer.toByteArray(), destinationJar);
         } catch (IOException e) {
             alerts.addError(e.getMessage());
         }
     }
 
-    public static void copy(InputStream from, OutputStream to) throws IOException {
-        byte[] buffer = new byte[1024];
-        int length = 0;
-        while ((length = from.read(buffer)) != -1) {
-            to.write(buffer, 0, length);
-        }
-    }
-
-    public static void close(Closeable closeable) throws IOException {
-        if (closeable == null) return;
-        try {
-            if (closeable instanceof Flushable) {
-                ((Flushable) closeable).flush();
-            }
-        } catch (IOException e) {
-            // no-op
-        }
-        try {
-            closeable.close();
-        } catch (IOException e) {
-            // no-op
-        }
-    }
-
-
-    private static void writeToFile(File file, ByteArrayOutputStream byteArrayOutputStream)
throws IOException {
-        final byte[] bytes = byteArrayOutputStream.toByteArray();
-
-        final FileOutputStream fileOutputStream = new FileOutputStream(file);
-        fileOutputStream.write(bytes);
-        fileOutputStream.close();
-    }
 
     private void removeTomcatLibJar(String name) {
         File annotationApi = new File(paths.getCatalinaLibDir(), name);

Modified: openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installers.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installers.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installers.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installers.java
Thu Mar  1 00:43:35 2012
@@ -16,6 +16,7 @@
  */
 package org.apache.tomee.installer;
 
+import org.apache.openejb.loader.IO;
 import org.codehaus.swizzle.stream.DelimitedTokenReplacementInputStream;
 import org.codehaus.swizzle.stream.StringTokenHandler;
 
@@ -26,9 +27,6 @@ import java.io.IOException;
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.OutputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.Closeable;
 
 /**
  * @version $Rev$ $Date$
@@ -37,16 +35,12 @@ public class Installers {
     public static String readEntry(JarFile jarFile, String name, Alerts alerts) {
         ZipEntry entry = jarFile.getEntry(name);
         if (entry == null) return null;
-        InputStream in = null;
         try {
-            in = jarFile.getInputStream(entry);
-            String text = readAll(in);
+            String text = IO.slurp(jarFile.getInputStream(entry));
             return text;
         } catch (Exception e) {
             alerts.addError("Unable to read " + name + " from " + jarFile.getName());
             return null;
-        } finally {
-            close(in);
         }
     }
 
@@ -56,8 +50,15 @@ public class Installers {
         ByteArrayInputStream in = new ByteArrayInputStream(inputText.getBytes());
 
         InputStream replacementStream = new DelimitedTokenReplacementInputStream(in, begin,
end, tokenHandler, true);
-        String newServerXml = readAll(replacementStream);
-        close(replacementStream);
+        // SwizzleStream block read methods are broken so read byte at a time
+        StringBuilder sb = new StringBuilder();
+        int i = replacementStream.read();
+        while (i != -1) {
+            sb.append((char) i);
+            i = replacementStream.read();
+        }
+        String newServerXml = sb.toString();
+        IO.close(replacementStream);
         return newServerXml;
     }
 
@@ -80,16 +81,7 @@ public class Installers {
             throw new IOException("Cannot create directory : " + destinationDir);
         }
 
-        InputStream in = null;
-        OutputStream out = null;
-        try {
-            in = new FileInputStream(source);
-            out = new FileOutputStream(destination);
-            writeAll(in, out);
-        } finally {
-            close(in);
-            close(out);
-        }
+        IO.copy(source, destination);
     }
 
     public static boolean writeAll(File file, String text, Alerts alerts) {
@@ -97,8 +89,7 @@ public class Installers {
     	
     	if (file.exists()) {
     		try {
-				FileInputStream is = new FileInputStream(file);
-				String oldText = readAll(is);
+				final String oldText = IO.slurp(file);
 				if (oldText.equals(text)) {
 					return true;
 				}
@@ -110,16 +101,12 @@ public class Installers {
             }
     	}
     	
-        FileOutputStream fileOutputStream = null;
         try {
-            fileOutputStream = new FileOutputStream(file);
-            writeAll(new ByteArrayInputStream(text.getBytes()), fileOutputStream);
+            IO.copy(IO.read(text), file);
             return true;
         } catch (Exception e) {
             alerts.addError("Unable to write to " + file.getAbsolutePath(), e);
             return false;
-        } finally {
-            close(fileOutputStream);
         }
     }
 
@@ -133,16 +120,12 @@ public class Installers {
     }
 
     public static String readAll(File file, Alerts alerts) {
-        FileInputStream in = null;
         try {
-            in = new FileInputStream(file);
-            String text = readAll(in);
+            String text = IO.slurp(file);
             return text;
         } catch (Exception e) {
             alerts.addError("Unable to read " + file.getAbsolutePath());
             return null;
-        } finally {
-            close(in);
         }
     }
 
@@ -150,38 +133,7 @@ public class Installers {
         if (destFile.exists() && destFile.isDirectory()) {
             throw new IOException("Destination '" + destFile + "' exists but is a directory");
         }
-
-        FileInputStream input = new FileInputStream(srcFile);
-        try {
-            FileOutputStream output = new FileOutputStream(destFile);
-            try {
-                writeAll(input, output);
-            } finally {
-                close(output);
-            }
-        } finally {
-            close(input);
-        }
-    }
-
-    public static String readAll(InputStream in) throws IOException {
-        // SwizzleStream block read methods are broken so read byte at a time
-        StringBuilder sb = new StringBuilder();
-        int i = in.read();
-        while (i != -1) {
-            sb.append((char) i);
-            i = in.read();
-        }
-        return sb.toString();
-    }
-
-    public static void close(Closeable thing) {
-        if (thing != null) {
-            try {
-                thing.close();
-            } catch (Exception ignored) {
-            }
-        }
+         IO.copy(srcFile, destFile);
     }
 
     public static class BeginEndTokenHandler extends StringTokenHandler {

Modified: openejb/trunk/openejb/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
Thu Mar  1 00:43:35 2012
@@ -38,6 +38,7 @@ import org.apache.openejb.assembler.clas
 import org.apache.openejb.assembler.classic.EnterpriseBeanInfo;
 import org.apache.openejb.assembler.classic.WebAppInfo;
 import org.apache.openejb.config.ConfigurationFactory;
+import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.util.Logger;
 import org.apache.tomee.catalina.TomcatLoader;
@@ -50,7 +51,6 @@ import org.apache.velocity.runtime.resou
 import javax.naming.Context;
 import javax.naming.NamingException;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
@@ -168,9 +168,8 @@ public class Container {
         properties.setProperty("openejb.servicemanager.enabled", "false");
 
         try {
-            Properties tomcatServerInfo = new Properties();
             ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-            tomcatServerInfo.load(classLoader.getResourceAsStream("org/apache/catalina/util/ServerInfo.properties"));
+            Properties tomcatServerInfo = IO.readProperties(classLoader.getResourceAsStream("org/apache/catalina/util/ServerInfo.properties"),
new Properties());
 
             String serverNumber = tomcatServerInfo.getProperty("server.number");
             if (serverNumber == null) {
@@ -313,20 +312,12 @@ public class Container {
     private void copyFileTo(File targetDir, String filename) throws IOException {
         InputStream is = getClass().getResourceAsStream("/org/apache/tomee/configs/" + filename);
         if (is != null) { // should be null since we are using default conf
-            copyStream(is, new FileOutputStream(new File(targetDir, filename)));
-        }
-    }
-
-    private void copyStream(InputStream is, FileOutputStream os) throws IOException {
-        byte[] buffer = new byte[8192];
-        int bytesRead = -1;
-
-        while ((bytesRead = is.read(buffer)) > -1) {
-            os.write(buffer, 0, bytesRead);
+            try {
+                IO.copy(is, new File(targetDir, filename));
+            } finally {
+                IO.close(is);
+            }
         }
-
-        is.close();
-        os.close();
     }
 
     private void createTomcatDirectories(File directory) {

Modified: openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatHook.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatHook.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatHook.java
(original)
+++ openejb/trunk/openejb/tomee/tomee-loader/src/main/java/org/apache/tomee/loader/TomcatHook.java
Thu Mar  1 00:43:35 2012
@@ -20,18 +20,14 @@ package org.apache.tomee.loader;
 import org.apache.openejb.loader.Embedder;
 import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.loader.Zips;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Properties;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
 
 import static org.apache.openejb.loader.ProvisioningUtil.realLocation;
 
@@ -138,9 +134,8 @@ class TomcatHook {
         // System.setProperty("tomcat.built", "mmm dd yyyy hh:mm:ss");
         // set the System properties, tomcat.version, tomcat.built
         try {
-            Properties tomcatServerInfo = new Properties();
             ClassLoader classLoader = TomcatHook.class.getClassLoader();
-            tomcatServerInfo.load(classLoader.getResourceAsStream("org/apache/catalina/util/ServerInfo.properties"));
+            Properties tomcatServerInfo = IO.readProperties(classLoader.getResourceAsStream("org/apache/catalina/util/ServerInfo.properties"),
new Properties());
 
             String serverNumber = tomcatServerInfo.getProperty("server.number");
             if (serverNumber == null) {
@@ -199,8 +194,7 @@ class TomcatHook {
             return;
         }
 
-        final Properties additionalLibProperties = new Properties();
-        additionalLibProperties.load(new FileInputStream(conf));
+        final Properties additionalLibProperties = IO.readProperties(conf);
 
         final List<String> libToCopy = new ArrayList<String>();
         final String toCopy = additionalLibProperties.getProperty(JAR_KEY);
@@ -268,50 +262,6 @@ class TomcatHook {
     }
 
     public static void unzip(final File source, final File targetDirectory) throws IOException
{
-        OutputStream os = null;
-        ZipInputStream is = null;
-        try {
-            is = new ZipInputStream(new FileInputStream(source));
-            ZipEntry entry;
-
-            while ((entry = is.getNextEntry()) != null) {
-                final String name = entry.getName();
-                final File file = new File(targetDirectory, name);
-
-                if (name.endsWith("/")) {
-                    file.mkdirs();
-                } else {
-                    file.createNewFile();
-
-                    int bytesRead;
-                    byte data[] = new byte[8192];
-
-                    os = new FileOutputStream(file);
-                    while ((bytesRead = is.read(data)) != -1) {
-                        os.write(data, 0, bytesRead);
-                    }
-
-                    is.closeEntry();
-                }
-
-            }
-        } finally {
-            if (is != null) {
-                try {
-                    is.close();
-                } catch (Exception e) {
-                    // no-op
-                }
-            }
-
-            if (os != null) {
-                try {
-                    os.close();
-                } catch (Exception e) {
-                    // no-op
-                }
-            }
-
-        }
+        Zips.unzip(source, targetDirectory);
     }
 }

Modified: openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/Resolver.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/Resolver.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/Resolver.java
(original)
+++ openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/Resolver.java
Thu Mar  1 00:43:35 2012
@@ -16,14 +16,12 @@
  */
 package org.apache.openejb.resolver;
 
-import org.apache.openejb.loader.FileUtils;
 import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.LocationResolver;
 import org.apache.openejb.resolver.maven.Handler;
 import org.apache.openejb.resolver.maven.Parser;
 
 import java.io.File;
-import java.io.FileOutputStream;
 import java.net.URL;
 
 import static org.apache.openejb.loader.ProvisioningUtil.cacheFile;
@@ -47,7 +45,7 @@ public class Resolver implements Locatio
                             throw new Exception("Failed to create: " + parentFile);
                         }
                     }
-                    FileUtils.copy(new FileOutputStream(file), IO.read(url));
+                    IO.copy(IO.read(url), file);
                 } catch (Exception e) {
                     if (file.exists()) {
                         if (!file.delete()) {

Modified: openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/maven/AetherBasedResolver.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/maven/AetherBasedResolver.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/maven/AetherBasedResolver.java
(original)
+++ openejb/trunk/openejb/utils/openejb-provisionning/src/main/java/org/apache/openejb/resolver/maven/AetherBasedResolver.java
Thu Mar  1 00:43:35 2012
@@ -20,6 +20,7 @@ import org.apache.maven.repository.inter
 import org.apache.maven.repository.internal.DefaultVersionRangeResolver;
 import org.apache.maven.repository.internal.DefaultVersionResolver;
 import org.apache.maven.repository.internal.MavenRepositorySystemSession;
+import org.apache.openejb.loader.IO;
 import org.ops4j.pax.url.maven.commons.MavenConfigurationImpl;
 import org.ops4j.pax.url.maven.commons.MavenRepositoryURL;
 import org.sonatype.aether.RepositoryException;
@@ -201,7 +202,7 @@ public class AetherBasedResolver {
         final RepositorySystemSession session = newSession();
         Artifact artifact = new DefaultArtifact(groupId, artifactId, classifier, extension,
version);
         File resolved = resolve(session, artifact);
-        return new FileInputStream(resolved);
+        return IO.read(resolved);
     }
 
     private File resolve(RepositorySystemSession session, Artifact artifact)

Modified: openejb/trunk/openejb/utils/webdeployer/src/main/java/org/apache/tomee/catalina/deployer/WebappDeployer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/utils/webdeployer/src/main/java/org/apache/tomee/catalina/deployer/WebappDeployer.java?rev=1295357&r1=1295356&r2=1295357&view=diff
==============================================================================
--- openejb/trunk/openejb/utils/webdeployer/src/main/java/org/apache/tomee/catalina/deployer/WebappDeployer.java
(original)
+++ openejb/trunk/openejb/utils/webdeployer/src/main/java/org/apache/tomee/catalina/deployer/WebappDeployer.java
Thu Mar  1 00:43:35 2012
@@ -43,7 +43,7 @@ import org.apache.openejb.assembler.clas
 import org.apache.openejb.assembler.classic.Assembler;
 import org.apache.openejb.assembler.classic.DeploymentExceptionManager;
 import org.apache.openejb.assembler.classic.WebAppBuilder;
-import org.apache.openejb.loader.FileUtils;
+import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomee.catalina.TomcatWebAppBuilder;
@@ -96,9 +96,9 @@ public class WebappDeployer implements D
 
 			File source = new File(location);
 			File destination = new File(System.getProperty(OPENEJB_HOME) + File.separator + WEBAPPS
+ File.separator + source.getName());
-			FileUtils.copyFile(destination, source);
+            IO.copy(source, destination);
 
-			String destinationWithoutExtension = destination.getAbsolutePath();
+            String destinationWithoutExtension = destination.getAbsolutePath();
 			String destinationFilenameWithoutExtension = destination.getName();
 
 			if (destination.getName().contains(".")) {



Mime
View raw message