Index: api/src/main/java/org/jboss/shrinkwrap/api/asset/FileAsset.java
===================================================================
--- api/src/main/java/org/jboss/shrinkwrap/api/asset/FileAsset.java	(revision 0)
+++ api/src/main/java/org/jboss/shrinkwrap/api/asset/FileAsset.java	(working copy)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.shrinkwrap.impl.base.asset;
+package org.jboss.shrinkwrap.api.asset;
 
 import java.io.BufferedInputStream;
 import java.io.File;
@@ -23,13 +23,12 @@
 import java.io.InputStream;
 
 import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.Validate;
 
 /**
  * FileAsset
- * 
+ *
  * Implementation of a {@link Asset} backed by a {@link File}
- * 
+ *
  * @author <a href="mailto:aslak@conduct.no">Aslak Knutsen</a>
  */
 public class FileAsset implements Asset
@@ -37,8 +36,8 @@
    private File file;
 
    /**
-    * Load the specified File. 
-    * 
+    * Load the specified File.
+    *
     * @param file The file to load
     * @throws IllegalArgumentException File can not be null
     * @throws IllegalArgumentException File must exist
@@ -46,7 +45,10 @@
    public FileAsset(File file)
    {
       // Precondition check
-      Validate.notNull(file, "File must be specified");
+       if (file == null)
+      {
+         throw new IllegalArgumentException("File must be specified");
+      }
       if (!file.exists())
       {
          throw new IllegalArgumentException("File must exist: " + file.getAbsolutePath());
@@ -56,10 +58,10 @@
 
    /**
     * Opens a new FileInputStream for the given File.
-    * 
-    * Can throw a Runtime exception if the file has been deleted inbetween 
-    * the FileResource was created and the stream is opened. 
-    * 
+    *
+    * Can throw a Runtime exception if the file has been deleted inbetween
+    * the FileResource was created and the stream is opened.
+    *
     * @throws RuntimeException If the file is not found.
     */
    @Override
@@ -75,3 +77,4 @@
       }
    }
 }
+
Index: api/src/main/java/org/jboss/shrinkwrap/api/asset/ByteArrayAsset.java
===================================================================
--- api/src/main/java/org/jboss/shrinkwrap/api/asset/ByteArrayAsset.java	(revision 0)
+++ api/src/main/java/org/jboss/shrinkwrap/api/asset/ByteArrayAsset.java	(working copy)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.shrinkwrap.impl.base.asset;
+package org.jboss.shrinkwrap.api.asset;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -22,12 +22,10 @@
 import java.util.logging.Logger;
 
 import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.Validate;
-import org.jboss.shrinkwrap.impl.base.io.IOUtil;
 
 /**
  * ByteArrayAsset
- * 
+ *
  * Implementation of a {@link Asset} backed by a byte array
  *
  * @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
@@ -61,14 +59,17 @@
    /**
     * Creates a new {@link Asset} instance backed by the specified
     * byte array
-    * 
+    *
     * @param content
     * @throws IllegalArgumentException If the contents were not specified
     */
    public ByteArrayAsset(final byte[] content) throws IllegalArgumentException
    {
       // Precondition check
-      Validate.notNull(content, "content must be specified");
+      if (content == null)
+      {
+         throw new IllegalArgumentException("content must be specified");
+      }
 
       // Defensive copy on set, SHRINKWRAP-38
       final int length = content.length;
@@ -86,14 +87,14 @@
    /**
     * Creates a new {@link Asset} instance backed by the bytes
     * contained in the the specified {@link InputStream}
-    * 
+    *
     * @param stream
     * @throws IllegalArgumentException If the stream is not specified
     */
    public ByteArrayAsset(final InputStream stream)
    {
       // Delegate
-      this(IOUtil.asByteArray(stream));
+      this(ByteArrayIOUtil.asByteArray(stream));
    }
 
    //-------------------------------------------------------------------------------------||
@@ -119,3 +120,4 @@
       return "ByteArrayAsset [content size=" + content.length + "bytes]";
    }
 }
+
Index: api/src/main/java/org/jboss/shrinkwrap/api/asset/UrlAsset.java
===================================================================
--- api/src/main/java/org/jboss/shrinkwrap/api/asset/UrlAsset.java	(revision 0)
+++ api/src/main/java/org/jboss/shrinkwrap/api/asset/UrlAsset.java	(working copy)
@@ -14,22 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.jboss.shrinkwrap.impl.base.asset;
+package org.jboss.shrinkwrap.api.asset;
 
 import java.io.BufferedInputStream;
 import java.io.InputStream;
 import java.net.URL;
 
 import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.Validate;
 
 /**
  * UrlAsset
- * 
- * Implementation of a {@link Asset} backed by a {@link URL}.  
+ *
+ * Implementation of a {@link Asset} backed by a {@link URL}.
  * The URL may be of any backing protocol supported by the runtime
  * (ie. has a handler registered).
- * 
+ *
  * @author <a href="mailto:aslak@conduct.no">Aslak Knutsen</a>
  *
  */
@@ -39,20 +38,23 @@
 
    /**
     * Create a new resource with a <code>URL</code> source.
-    * 
+    *
     * @param url A valid URL
     * @throws IllegalArgumentException <Code>URL</code> can not be null
     */
    public UrlAsset(URL url)
    {
       // Precondition check
-      Validate.notNull(url, "URL must be specified");
+      if (url == null)
+      {
+         throw new IllegalArgumentException("URL must be specified");
+      }
       this.url = url;
    }
 
    /**
     * Open the <code>URL</code> stream.
-    * 
+    *
     * @return A open stream with the content of the URL
     */
    @Override
@@ -68,3 +70,4 @@
       }
    }
 }
+
Index: api/src/main/java/org/jboss/shrinkwrap/api/asset/ByteArrayIOUtil.java
===================================================================
--- api/src/main/java/org/jboss/shrinkwrap/api/asset/ByteArrayIOUtil.java	(revision 0)
+++ api/src/main/java/org/jboss/shrinkwrap/api/asset/ByteArrayIOUtil.java	(revision 0)
@@ -0,0 +1,85 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.shrinkwrap.api.asset;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * ByteArrayIOUtil
+ *
+ * Class that helps get byte array from {@link InputStream}. Needed by the common assets in api.
+ * Method asByteArray was refactored and moved out of {@link org.jboss.shrinkwrap.impl.base.io.IOUtil}
+ * which now uses it from here via {@link org.jboss.shrinkwrap.api.asset.IOUtilDelegator}.
+ *
+ * @author <a href="mailto:ken@glxn.no">Ken Gullaksen</a>
+ * @version $Revision: $
+ */
+class ByteArrayIOUtil {
+
+    private static final Logger log = Logger.getLogger(ByteArrayIOUtil.class.getName());
+
+    public static byte[] asByteArray(final InputStream in) throws IllegalArgumentException
+   {
+      // Precondition check
+       if (in == null)
+      {
+         throw new IllegalArgumentException("stream must be specified");
+      }
+
+      // Get content as an array of bytes
+      final ByteArrayOutputStream out = new ByteArrayOutputStream(8192);
+      final int len = 4096;
+      final byte[] buffer = new byte[len];
+      int read = 0;
+      try
+      {
+         while (((read = in.read(buffer)) != -1))
+         {
+            out.write(buffer, 0, read);
+         }
+      }
+      catch (final IOException ioe)
+      {
+         throw new RuntimeException("Error in obtainting bytes from " + in, ioe);
+      }
+      finally
+      {
+         try
+         {
+            in.close();
+         }
+         catch (final IOException ignore)
+         {
+            if (log.isLoggable(Level.FINER))
+            {
+               log.finer("Could not close stream due to: " + ignore.getMessage() + "; ignoring");
+            }
+         }
+         // We don't need to close the outstream, it's a byte array out
+      }
+
+      // Represent as byte array
+      final byte[] content = out.toByteArray();
+
+      // Return
+      return content;
+   }
+}
Index: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/FileAssetTestCase.java
===================================================================
--- impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/FileAssetTestCase.java	(revision 4338)
+++ impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/FileAssetTestCase.java	(working copy)
@@ -22,6 +22,7 @@
 import junit.framework.Assert;
 
 import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
 import org.junit.Test;
 
 /**
Index: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAssetTestCase.java
===================================================================
--- impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAssetTestCase.java	(revision 4338)
+++ impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAssetTestCase.java	(working copy)
@@ -23,12 +23,13 @@
 
 import junit.framework.Assert;
 
+import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
 import org.junit.Test;
 
 /**
  * ByteArrayAssetTestCase
  * 
- * Test Cases for the {@link ByteArrayAsset}
+ * Test Cases for the {@link org.jboss.shrinkwrap.api.asset.ByteArrayAsset}
  *
  * @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
  * @version $Revision: $
Index: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/UrlAssetTestCase.java
===================================================================
--- impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/UrlAssetTestCase.java	(revision 4338)
+++ impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/UrlAssetTestCase.java	(working copy)
@@ -21,6 +21,7 @@
 import junit.framework.Assert;
 
 import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.asset.UrlAsset;
 import org.junit.Test;
 
 /**
Index: impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ZipExporterStressTest.java
===================================================================
--- impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ZipExporterStressTest.java	(revision 4338)
+++ impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/exporter/ZipExporterStressTest.java	(working copy)
@@ -28,9 +28,9 @@
 
 import org.jboss.shrinkwrap.api.Asset;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
 import org.jboss.shrinkwrap.api.exporter.ZipExporter;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
 import org.jboss.shrinkwrap.impl.base.io.IOUtil;
 import org.junit.Test;
 
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/FileAsset.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/FileAsset.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/FileAsset.java	(working copy)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.asset;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-
-import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.Validate;
-
-/**
- * FileAsset
- * 
- * Implementation of a {@link Asset} backed by a {@link File}
- * 
- * @author <a href="mailto:aslak@conduct.no">Aslak Knutsen</a>
- */
-public class FileAsset implements Asset
-{
-   private File file;
-
-   /**
-    * Load the specified File. 
-    * 
-    * @param file The file to load
-    * @throws IllegalArgumentException File can not be null
-    * @throws IllegalArgumentException File must exist
-    */
-   public FileAsset(File file)
-   {
-      // Precondition check
-      Validate.notNull(file, "File must be specified");
-      if (!file.exists())
-      {
-         throw new IllegalArgumentException("File must exist: " + file.getAbsolutePath());
-      }
-      this.file = file;
-   }
-
-   /**
-    * Opens a new FileInputStream for the given File.
-    * 
-    * Can throw a Runtime exception if the file has been deleted inbetween 
-    * the FileResource was created and the stream is opened. 
-    * 
-    * @throws RuntimeException If the file is not found.
-    */
-   @Override
-   public InputStream openStream()
-   {
-      try
-      {
-         return new BufferedInputStream(new FileInputStream(file), 8192);
-      }
-      catch (FileNotFoundException e)
-      {
-         throw new RuntimeException("Could not open file " + file, e);
-      }
-   }
-}
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAsset.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAsset.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAsset.java	(working copy)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.asset;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.Validate;
-import org.jboss.shrinkwrap.impl.base.io.IOUtil;
-
-/**
- * ByteArrayAsset
- * 
- * Implementation of a {@link Asset} backed by a byte array
- *
- * @author <a href="mailto:andrew.rubinger@jboss.org">ALR</a>
- * @version $Revision: $
- */
-public class ByteArrayAsset implements Asset
-{
-
-   //-------------------------------------------------------------------------------------||
-   // Class Members ----------------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   /**
-    * Logger
-    */
-   private static final Logger log = Logger.getLogger(ByteArrayAsset.class.getName());
-
-   //-------------------------------------------------------------------------------------||
-   // Instance Members -------------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   /**
-    * Underlying content
-    */
-   private final byte[] content;
-
-   //-------------------------------------------------------------------------------------||
-   // Constructor ------------------------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   /**
-    * Creates a new {@link Asset} instance backed by the specified
-    * byte array
-    * 
-    * @param content
-    * @throws IllegalArgumentException If the contents were not specified
-    */
-   public ByteArrayAsset(final byte[] content) throws IllegalArgumentException
-   {
-      // Precondition check
-      Validate.notNull(content, "content must be specified");
-
-      // Defensive copy on set, SHRINKWRAP-38
-      final int length = content.length;
-      byte[] newArray = new byte[length];
-      System.arraycopy(content, 0, newArray, 0, length);
-
-      // Set
-      this.content = newArray;
-      if (log.isLoggable(Level.FINER))
-      {
-         log.finer("Created " + this + " with backing byte array of size " + length + "b");
-      }
-   }
-
-   /**
-    * Creates a new {@link Asset} instance backed by the bytes
-    * contained in the the specified {@link InputStream}
-    * 
-    * @param stream
-    * @throws IllegalArgumentException If the stream is not specified
-    */
-   public ByteArrayAsset(final InputStream stream)
-   {
-      // Delegate
-      this(IOUtil.asByteArray(stream));
-   }
-
-   //-------------------------------------------------------------------------------------||
-   // Required Implementations -----------------------------------------------------------||
-   //-------------------------------------------------------------------------------------||
-
-   /**
-    * @see org.jboss.shrinkwrap.api.Asset#openStream()
-    */
-   @Override
-   public InputStream openStream()
-   {
-      return new ByteArrayInputStream(this.content);
-   }
-
-   /**
-    * {@inheritDoc}
-    * @see java.lang.Object#toString()
-    */
-   @Override
-   public String toString()
-   {
-      return "ByteArrayAsset [content size=" + content.length + "bytes]";
-   }
-}
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/UrlAsset.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/UrlAsset.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/UrlAsset.java	(working copy)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.shrinkwrap.impl.base.asset;
-
-import java.io.BufferedInputStream;
-import java.io.InputStream;
-import java.net.URL;
-
-import org.jboss.shrinkwrap.api.Asset;
-import org.jboss.shrinkwrap.impl.base.Validate;
-
-/**
- * UrlAsset
- * 
- * Implementation of a {@link Asset} backed by a {@link URL}.  
- * The URL may be of any backing protocol supported by the runtime
- * (ie. has a handler registered).
- * 
- * @author <a href="mailto:aslak@conduct.no">Aslak Knutsen</a>
- *
- */
-public class UrlAsset implements Asset
-{
-   private URL url;
-
-   /**
-    * Create a new resource with a <code>URL</code> source.
-    * 
-    * @param url A valid URL
-    * @throws IllegalArgumentException <Code>URL</code> can not be null
-    */
-   public UrlAsset(URL url)
-   {
-      // Precondition check
-      Validate.notNull(url, "URL must be specified");
-      this.url = url;
-   }
-
-   /**
-    * Open the <code>URL</code> stream.
-    * 
-    * @return A open stream with the content of the URL
-    */
-   @Override
-   public InputStream openStream()
-   {
-      try
-      {
-         return new BufferedInputStream(url.openStream(), 8192);
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException("Could not open stream for url " + url.toExternalForm(), e);
-      }
-   }
-}
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ResourceAdapterContainerBase.java	(working copy)
@@ -21,11 +21,11 @@
 
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.shrinkwrap.api.asset.UrlAsset;
 import org.jboss.shrinkwrap.api.container.ResourceAdapterContainer;
 import org.jboss.shrinkwrap.impl.base.Validate;
 import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.impl.base.asset.FileAsset;
-import org.jboss.shrinkwrap.impl.base.asset.UrlAsset;
 
 /**
  * ResourceAdapterContainerBase
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/WebContainerBase.java	(working copy)
@@ -23,12 +23,12 @@
 import org.jboss.shrinkwrap.api.ArchivePaths;
 import org.jboss.shrinkwrap.api.Asset;
 import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.shrinkwrap.api.asset.UrlAsset;
 import org.jboss.shrinkwrap.api.container.WebContainer;
 import org.jboss.shrinkwrap.impl.base.Validate;
 import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
 import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.impl.base.asset.FileAsset;
-import org.jboss.shrinkwrap.impl.base.asset.UrlAsset;
 import org.jboss.shrinkwrap.impl.base.path.BasicPath;
 
 /**
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/ContainerBase.java	(working copy)
@@ -29,6 +29,8 @@
 import org.jboss.shrinkwrap.api.Filter;
 import org.jboss.shrinkwrap.api.Filters;
 import org.jboss.shrinkwrap.api.Node;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.shrinkwrap.api.asset.UrlAsset;
 import org.jboss.shrinkwrap.api.container.ClassContainer;
 import org.jboss.shrinkwrap.api.container.LibraryContainer;
 import org.jboss.shrinkwrap.api.container.ManifestContainer;
@@ -40,9 +42,7 @@
 import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
 import org.jboss.shrinkwrap.impl.base.asset.ClassAsset;
 import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.impl.base.asset.FileAsset;
 import org.jboss.shrinkwrap.impl.base.asset.ServiceProviderAsset;
-import org.jboss.shrinkwrap.impl.base.asset.UrlAsset;
 import org.jboss.shrinkwrap.impl.base.path.BasicPath;
 
 /**
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/container/EnterpriseContainerBase.java	(working copy)
@@ -23,12 +23,12 @@
 import org.jboss.shrinkwrap.api.ArchivePaths;
 import org.jboss.shrinkwrap.api.Asset;
 import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
+import org.jboss.shrinkwrap.api.asset.UrlAsset;
 import org.jboss.shrinkwrap.api.container.EnterpriseContainer;
 import org.jboss.shrinkwrap.impl.base.Validate;
 import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
 import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
-import org.jboss.shrinkwrap.impl.base.asset.FileAsset;
-import org.jboss.shrinkwrap.impl.base.asset.UrlAsset;
 import org.jboss.shrinkwrap.impl.base.path.BasicPath;
 
 /**
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ZipImporterImpl.java	(working copy)
@@ -26,11 +26,11 @@
 import java.util.zip.ZipInputStream;
 
 import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.ByteArrayAsset;
 import org.jboss.shrinkwrap.api.importer.ArchiveImportException;
 import org.jboss.shrinkwrap.api.importer.ZipImporter;
 import org.jboss.shrinkwrap.impl.base.AssignableBase;
 import org.jboss.shrinkwrap.impl.base.Validate;
-import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
 import org.jboss.shrinkwrap.impl.base.asset.ZipFileEntryAsset;
 import org.jboss.shrinkwrap.impl.base.path.BasicPath;
 
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/importer/ExplodedImporterImpl.java	(working copy)
@@ -22,10 +22,10 @@
 
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.ArchivePath;
+import org.jboss.shrinkwrap.api.asset.FileAsset;
 import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
 import org.jboss.shrinkwrap.impl.base.AssignableBase;
 import org.jboss.shrinkwrap.impl.base.Validate;
-import org.jboss.shrinkwrap.impl.base.asset.FileAsset;
 import org.jboss.shrinkwrap.impl.base.path.BasicPath;
 
 /**
Index: impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java	(revision 4338)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java	(working copy)
@@ -16,7 +16,8 @@
  */
 package org.jboss.shrinkwrap.impl.base.io;
 
-import java.io.ByteArrayOutputStream;
+import org.jboss.shrinkwrap.api.asset.IOUtilDelegator;
+
 import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
@@ -24,7 +25,6 @@
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.jboss.shrinkwrap.impl.base.Validate;
 
 /**
  * Generic input/output utilities
@@ -83,46 +83,7 @@
     */
    public static byte[] asByteArray(final InputStream in) throws IllegalArgumentException
    {
-      // Precondition check
-      Validate.notNull(in, "stream must be specified");
-
-      // Get content as an array of bytes
-      final ByteArrayOutputStream out = new ByteArrayOutputStream(8192);
-      final int len = 4096;
-      final byte[] buffer = new byte[len];
-      int read = 0;
-      try
-      {
-         while (((read = in.read(buffer)) != -1))
-         {
-            out.write(buffer, 0, read);
-         }
-      }
-      catch (final IOException ioe)
-      {
-         throw new RuntimeException("Error in obtainting bytes from " + in, ioe);
-      }
-      finally
-      {
-         try
-         {
-            in.close();
-         }
-         catch (final IOException ignore)
-         {
-            if (log.isLoggable(Level.FINER))
-            {
-               log.finer("Could not close stream due to: " + ignore.getMessage() + "; ignoring");
-            }
-         }
-         // We don't need to close the outstream, it's a byte array out
-      }
-
-      // Represent as byte array
-      final byte[] content = out.toByteArray();
-
-      // Return
-      return content;
+       return IOUtilDelegator.asByteArray(in);
    }
 
    /**
Index: impl-base/src/main/java/org/jboss/shrinkwrap/api/asset/IOUtilDelegator.java
===================================================================
--- impl-base/src/main/java/org/jboss/shrinkwrap/api/asset/IOUtilDelegator.java	(revision 0)
+++ impl-base/src/main/java/org/jboss/shrinkwrap/api/asset/IOUtilDelegator.java	(revision 0)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.shrinkwrap.api.asset;
+
+import java.io.InputStream;
+
+/**
+ * IOUtilDelegator
+ *
+ * Class that helps expose package private {@link ByteArrayIOUtil}
+ *
+ * @author <a href="mailto:ken@glxn.no">Ken Gullaksen</a>
+ * @version $Revision: $
+ */
+public class IOUtilDelegator {
+    public static byte[] asByteArray(final InputStream in) throws IllegalArgumentException
+    {
+        return ByteArrayIOUtil.asByteArray(in);
+    }
+
+}
