[jboss-svn-commits] JBoss Common SVN: r3513 - in declarchive/trunk: api and 64 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Sep 12 18:35:44 EDT 2009
Author: ALRubinger
Date: 2009-09-12 18:35:41 -0400 (Sat, 12 Sep 2009)
New Revision: 3513
Added:
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/ArchiveFactory.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Asset.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/AssetNotFoundException.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/EnterpriseArchiveFactory.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/FactoryUtil.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/JavaArchiveFactory.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Path.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/WebArchiveFactory.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ContainerBase.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseArchiveFactoryImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseContainerBase.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/JavaArchiveFactoryImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ResourceNotFoundException.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/SecurityActions.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/Validate.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebArchiveFactoryImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebContainerBase.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImplTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImplTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImplTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/donotchange/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/
declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/
declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/
declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/
declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/
declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/
declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/
declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/
declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/
declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/
declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/
declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/
declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/
declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/jdk/
declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/jdk/file/
declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/spi/
declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/spi/vfs/
declarchive/trunk/spi/src/main/java/org/jboss/shrinkwrap/
declarchive/trunk/spi/src/main/java/org/jboss/shrinkwrap/spi/
Removed:
declarchive/trunk/api/src/main/java/org/jboss/declarchive/
declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/
declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/
declarchive/trunk/impl-base/src/test/resources/org/jboss/declarchive/impl/base/asset/
declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/declarchive/
declarchive/trunk/impl-vfs/src/main/java/org/jboss/declarchive/
declarchive/trunk/impl-vfs/src/test/java/org/jboss/declarchive/
declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/declarchive/
declarchive/trunk/spi-vfs/src/main/java/org/jboss/declarchive/
declarchive/trunk/spi/src/main/java/org/jboss/declarchive/
Modified:
declarchive/trunk/api/pom.xml
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ClassContainer.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ArchiveExportException.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ExplodedExporter.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/FactoryUtil.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ZipExporter.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/ArchiveFactory.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/JavaArchive.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/SecurityActions.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/VfsMemoryArchiveFactory.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchive.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchive.java
declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchive.java
declarchive/trunk/build/pom.xml
declarchive/trunk/impl-base/pom.xml
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ArchiveAsset.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAsset.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ClassAsset.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ClassLoaderAsset.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/FileAsset.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/SecurityActions.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/UrlAsset.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/AbstractExporterDelegate.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterDelegate.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ZipExportDelegate.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/BasicPath.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/PathUtil.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImpl.java
declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImpl.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtilTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ClassAssetTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ClassLoaderAssetTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/FileAssetTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/TestUtils.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/UrlAssetTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/BasicPathTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/PathUtilTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/donotchange/DummyClassUsedForClassResourceTest.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/MemoryMapArchiveTestCase.java
declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java
declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/Test.properties
declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/Test2.properties
declarchive/trunk/impl-jdkfile/pom.xml
declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/SecurityActions.java
declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/TempFileArchiveImpl.java
declarchive/trunk/impl-vfs/pom.xml
declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/VfsArchiveBase.java
declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveImpl.java
declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveFactoryTestCase.java
declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveTestCase.java
declarchive/trunk/pom.xml
declarchive/trunk/spi-jdkfile/pom.xml
declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/jdk/file/FileArchive.java
declarchive/trunk/spi-vfs/pom.xml
declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/spi/vfs/VfsArchive.java
declarchive/trunk/spi/pom.xml
declarchive/trunk/spi/src/main/java/org/jboss/shrinkwrap/spi/MemoryMapArchive.java
Log:
[TMPARCH-20] Refactor to org.jboss.shrinkwrap
Modified: declarchive/trunk/api/pom.xml
===================================================================
--- declarchive/trunk/api/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,10 +17,10 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-api</artifactId>
+ <artifactId>shrinkwrap-api</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive API</name>
- <description>Client View of the Declarchive Project</description>
+ <name>ShrinkWrap API</name>
+ <description>Client View of the ShrinkWrap Project</description>
<!-- Properties -->
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Archive.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Archive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,163 @@
+/*
+ * 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.api;
+
+import java.util.Map;
+
+/**
+ * Archive
+ *
+ * Represents a collection of resources which may
+ * be constructed declaratively / programmatically.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface Archive<T extends Archive<T>>
+{
+ //-------------------------------------------------------------------------------------||
+ // Contracts --------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Obtains the name of this archive (ie. myLibrary.jar)
+ */
+ String getName();
+
+ /**
+ * Adds the specified asset under the specified path into the
+ * target context
+ *
+ * @param target The context under which to add the assets
+ * @param asset
+ * @return
+ * @throws IllegalArgumentException If no target or assets were specified
+ */
+ T add(Path target, Asset asset) throws IllegalArgumentException;
+
+ /**
+ * Adds the specified asset under the specified target (directory)
+ * using the specified name. The resultant path will be treating
+ * the specified path as a prefix namespace, then appending the name.
+ *
+ * @param target The context directory under which to add the asset
+ * @param name The name to assign the assent under the target namespace
+ * @param asset
+ * @return
+ * @throws IllegalArgumentException If the target, name, or asset was not specified
+ */
+ T add(Path target, String name, Asset asset) throws IllegalArgumentException;
+
+ /**
+ * Adds the specified resource under the context denoted by the specified target
+ *
+ * @param target
+ * @param asset
+ * @return
+ * @throws IllegalArgumentException If either the target or asset is not specified
+ */
+ T add(String target, Asset asset) throws IllegalArgumentException;
+
+ /**
+ * Obtains the asset located at the specified path
+ *
+ * @param path
+ * @return
+ * @throws AssetNotFoundException If the specified path does not
+ * point to any asset in the archive
+ * @throws IllegalArgumentException If the path is not specified
+ */
+ Asset get(Path path) throws AssetNotFoundException, IllegalArgumentException;
+
+ /**
+ * Obtains the asset located at the specified path
+ *
+ * @param path
+ * @return
+ * @throws AssetNotFoundException If the specified path does not
+ * point to any resource in the archive
+ * @throws IllegalArgumentException If the path is not specified
+ */
+ Asset get(String path) throws AssetNotFoundException, IllegalArgumentException;
+
+ /**
+ * Denotes whether this archive contains a resource at the specified
+ * path
+ *
+ * @param path
+ * @return
+ * @throws IllegalArgumentException If the path is not specified
+ */
+ boolean contains(Path path) throws IllegalArgumentException;
+
+ /**
+ * Removes the asset in the archive at the specified Path. If the path
+ * is a directory, recursively removes all contents.
+ *
+ * @param path
+ * @return Whether or not a deletion was made
+ */
+ boolean delete(Path path) throws IllegalArgumentException;
+
+ /**
+ * Obtains all assets in this archive, along with its respective Path.
+ * The returned Map will be an immutable view.
+ * @return
+ */
+ Map<Path, Asset> getContent();
+
+ /**
+ * Add an archive under a specific context and maintain the archive name as context path.
+ *
+ * @param path to use
+ * @param archive to add
+ * @return
+ * @throws IllegalArgumentException If the path or archive are not specified
+ */
+ T add(Path path, Archive<?> archive) throws IllegalArgumentException;
+
+ /**
+ * Merge the contents from an existing archive without
+ * maintaining the archive name in the context path.
+ *
+ * @param source Archive to add contents from
+ * @return
+ * @throws IllegalArgumentException If the existing archive is not specified
+ */
+ T merge(Archive<?> source) throws IllegalArgumentException;
+
+ /**
+ * Merge the contents from an existing archive in a specific path
+ * without maintaining the archive name in the context path.
+ *
+ * @param path Path to add contents to
+ * @param source Archive to add contents from
+ * @return
+ * @throws IllegalArgumentException If the path or existing archive is not specified
+ */
+ T merge(Path path, Archive<?> source) throws IllegalArgumentException;
+
+ /**
+ * Returns a multiline "ls -l"-equse output of the contents of
+ * this deployment and (recursively) its children if the verbosity
+ * flag is set to "true". Otherwise the no-arg version is invoked
+ *
+ * @return
+ */
+ String toString(boolean verbose);
+
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/ArchiveFactory.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/ArchiveFactory.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/ArchiveFactory.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/ArchiveFactory.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,67 @@
+/*
+ * 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.api;
+
+/**
+ * ArchiveFactory
+ *
+ * Template Factory used to create {@link Archive} instances.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+abstract class ArchiveFactory<T extends Archive<T>>
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Methods ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Create an instance of an ArchiveFactory implementation
+ *
+ * @return ArchiveFactory instance
+ */
+ protected synchronized static <T extends Archive<T>, F extends ArchiveFactory<T>> F createInstance(
+ Class<F> factoryBaseType, String fqFactoryName)
+ {
+ try
+ {
+ // Create the instance
+ F instance = FactoryUtil.createInstance(fqFactoryName, factoryBaseType);
+
+ // Return the instance
+ return instance;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Make sure you have the impl classes on your runtime classpath", e);
+ }
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Contracts --------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Template create method for concrete implementations
+ *
+ * @param archiveName
+ * @return Archive instance
+ */
+ protected abstract T doCreate(String archiveName);
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Asset.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Asset.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Asset.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Asset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,37 @@
+/*
+ * 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.api;
+
+import java.io.InputStream;
+
+/**
+ * Represents a Class, file, or any other collection
+ * of bytes stored under some context within an {@link Archive}
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ */
+public interface Asset
+{
+ /**
+ * Get a input stream for the resource content.
+ * The caller is responsible for closing the stream.
+ *
+ * @return A new open inputstream for each call.
+ */
+ InputStream getStream();
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/AssetNotFoundException.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/AssetNotFoundException.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/AssetNotFoundException.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/AssetNotFoundException.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,63 @@
+/*
+ * 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.api;
+
+/**
+ * AssetNotFoundException
+ *
+ * Thrown when an asset is requested, but could not be found
+ * within the context of the given archive at the specified path
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class AssetNotFoundException extends IllegalArgumentException
+{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ //-------------------------------------------------------------------------------------||
+ // Constructors -----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ public AssetNotFoundException()
+ {
+ super();
+ }
+
+ public AssetNotFoundException(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public AssetNotFoundException(final String s)
+ {
+ super(s);
+ }
+
+ public AssetNotFoundException(final Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/EnterpriseArchiveFactory.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/EnterpriseArchiveFactory.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/EnterpriseArchiveFactory.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/EnterpriseArchiveFactory.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,76 @@
+/*
+ * 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.api;
+
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+
+/**
+ * EnterpriseArchiveFactory
+ *
+ * Factory used to create {@link EnterpriseArchive} instances.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public abstract class EnterpriseArchiveFactory extends ArchiveFactory<EnterpriseArchive>
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Implementation type as a FQN to avoid direct compile-time dependency
+ */
+ private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.EnterpriseArchiveFactoryImpl";
+
+ /**
+ * Instance of EnterpriseArchiveFactory implementation
+ */
+ private static EnterpriseArchiveFactory instance;
+
+ //-------------------------------------------------------------------------------------||
+ // Class Methods ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Creates a {@link EnterpriseArchive} instance with the provided name.
+ *
+ * @param archiveName
+ * @return EnterpriseArchive instance
+ * @throws IllegalArgumentException if the archiveName is not present
+ */
+ public static EnterpriseArchive create(String archiveName)
+ {
+ return getInstance().doCreate(archiveName);
+ }
+
+ /**
+ * Return instance of the EnterpriseArchiveFactory
+ *
+ * @return
+ */
+ private synchronized static EnterpriseArchiveFactory getInstance()
+ {
+ if (instance == null)
+ {
+ instance = createInstance(EnterpriseArchiveFactory.class, IMPL_TYPE);
+ }
+ return instance;
+ }
+
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/FactoryUtil.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/FactoryUtil.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/FactoryUtil.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/FactoryUtil.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,106 @@
+/*
+ * 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.api;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.logging.Logger;
+
+/**
+ * FactoryUtil
+ *
+ * Package-private factory utilities
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+class FactoryUtil
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(FactoryUtil.class.getName());
+
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Prohibit instantiation
+ */
+ private FactoryUtil()
+ {
+ throw new UnsupportedOperationException("No instances should be created; stateless utility class");
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Functional Methods -----------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Create an instance of the Class with the specified FQN, of the expected
+ * type
+ *
+ * @throws IllegalArgumentException If the specified type is not assignable to the instance
+ * of the class created from the specified class name, or if either argument is not
+ * supplied
+ */
+ static <T> T createInstance(final String className, final Class<T> type) throws IllegalArgumentException
+ {
+ // Precondition checks
+ if (className == null || className.length() == 0)
+ {
+ throw new IllegalArgumentException("className must be specified");
+ }
+ if (type == null)
+ {
+ throw new IllegalArgumentException("type must be specified");
+ }
+
+ return AccessController.doPrivileged(new PrivilegedAction<T>()
+ {
+ public T run()
+ {
+ try
+ {
+ final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+ final Class<?> clazz = Class.forName(className, false, classLoader);
+ final Object obj = clazz.newInstance();
+ try
+ {
+ return type.cast(obj);
+ }
+ catch (final ClassCastException cee)
+ {
+ throw new IllegalArgumentException("Specified type " + type.getName() + " is not assignable to "
+ + obj);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new IllegalArgumentException("Unable to create implemenation: " + className, e);
+ }
+ }
+ });
+ }
+
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/JavaArchiveFactory.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/JavaArchiveFactory.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/JavaArchiveFactory.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/JavaArchiveFactory.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,75 @@
+/*
+ * 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.api;
+
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+
+/**
+ * JavaArchiveFactory
+ *
+ * Factory used to create {@link JavaArchive} instances.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public abstract class JavaArchiveFactory extends ArchiveFactory<JavaArchive>
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Implementation type as a FQN to avoid direct compile-time dependency
+ */
+ private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.JavaArchiveFactoryImpl";
+
+ /**
+ * Instance of JavaArchiveFactory implementation
+ */
+ private static JavaArchiveFactory instance;
+
+ //-------------------------------------------------------------------------------------||
+ // Class Methods ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Creates a {@link JavaArchive} instance with the provided name.
+ *
+ * @param archiveName
+ * @return JavaArchive
+ * @throws IllegalArgumentException if the archiveName is not present
+ */
+ public static JavaArchive create(String archiveName)
+ {
+ return getInstance().doCreate(archiveName);
+ }
+
+ /**
+ * Return instance of the JavaArchiveFactory
+ *
+ * @return
+ */
+ private synchronized static JavaArchiveFactory getInstance()
+ {
+ if (instance == null)
+ {
+ instance = createInstance(JavaArchiveFactory.class, IMPL_TYPE);
+ }
+ return instance;
+ }
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Path.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/Path.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Path.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/Path.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,36 @@
+/*
+ * 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.api;
+
+/**
+ * Path
+ *
+ * Represents a target context within an {@link Archive} under
+ * which an {@link Asset} may be found.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public interface Path extends Comparable<Path>
+{
+ /**
+ * Obtains the context which this Path represents
+ *
+ * @return
+ */
+ String get();
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/WebArchiveFactory.java (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/WebArchiveFactory.java)
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/WebArchiveFactory.java (rev 0)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/WebArchiveFactory.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,75 @@
+/*
+ * 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.api;
+
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+/**
+ * WebArchiveFactory
+ *
+ * Factory used to create {@link WebArchive} instances.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public abstract class WebArchiveFactory extends ArchiveFactory<WebArchive>
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Implementation type as a FQN to avoid direct compile-time dependency
+ */
+ private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.WebArchiveFactoryImpl";
+
+ /**
+ * Instance of WebArchiveFactory implementation
+ */
+ private static WebArchiveFactory instance;
+
+ //-------------------------------------------------------------------------------------||
+ // Class Methods ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Creates a {@link WebArchive} instance with the provided name.
+ *
+ * @param archiveName
+ * @return WebArchive instance
+ * @throws IllegalArgumentException if the archiveName is not present
+ */
+ public static WebArchive create(String archiveName)
+ {
+ return getInstance().doCreate(archiveName);
+ }
+
+ /**
+ * Return instance of the WebArchiveFactory
+ *
+ * @return
+ */
+ private synchronized static WebArchiveFactory getInstance()
+ {
+ if (instance == null)
+ {
+ instance = createInstance(WebArchiveFactory.class, IMPL_TYPE);
+ }
+ return instance;
+ }
+}
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container)
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ClassContainer.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container/ClassContainer.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ClassContainer.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.container;
+package org.jboss.shrinkwrap.api.container;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* ClassContainer
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container/EnterpriseContainer.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/EnterpriseContainer.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.container;
+package org.jboss.shrinkwrap.api.container;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
/**
* EnterpriseContainer
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container/LibraryContainer.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/LibraryContainer.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.container;
+package org.jboss.shrinkwrap.api.container;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
/**
* LibraryContainer
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container/ManifestContainer.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ManifestContainer.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.container;
+package org.jboss.shrinkwrap.api.container;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
/**
* ManifestContainer
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container/ResourceContainer.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/ResourceContainer.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.container;
+package org.jboss.shrinkwrap.api.container;
import java.net.URL;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
/**
* ResourceContainer
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/container/WebContainer.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/container/WebContainer.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.container;
+package org.jboss.shrinkwrap.api.container;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
/**
* WebContainer
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/export)
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ArchiveExportException.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/export/ArchiveExportException.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ArchiveExportException.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.export;
+package org.jboss.shrinkwrap.api.export;
/**
* ArchiveExportException
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ExplodedExporter.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/export/ExplodedExporter.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ExplodedExporter.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,11 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.export;
+package org.jboss.shrinkwrap.api.export;
import java.io.File;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* ExplodedExporter
@@ -38,7 +38,7 @@
/**
* Implementation type as a FQN to avoid direct compile-time dependency
*/
- private static final String IMPL_TYPE = "org.jboss.declarchive.impl.base.export.ExplodedExporterImpl";
+ private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.export.ExplodedExporterImpl";
/**
* Instance of ExplodedExporter implementation
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/FactoryUtil.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/export/FactoryUtil.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/FactoryUtil.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.export;
+package org.jboss.shrinkwrap.api.export;
import java.security.AccessController;
import java.security.PrivilegedAction;
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ZipExporter.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/export/ZipExporter.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/export/ZipExporter.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,11 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.export;
+package org.jboss.shrinkwrap.api.export;
import java.io.InputStream;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* ZipExporter
@@ -38,7 +38,7 @@
/**
* Implementation type as a FQN to avoid direct compile-time dependency
*/
- private static final String IMPL_TYPE = "org.jboss.declarchive.impl.base.export.ZipExporterImpl";
+ private static final String IMPL_TYPE = "org.jboss.shrinkwrap.impl.base.export.ZipExporterImpl";
/**
* Instance of ZipExporter implementation
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/mightmoveordelete)
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/ArchiveFactory.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/mightmoveordelete/ArchiveFactory.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/ArchiveFactory.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.mightmoveordelete;
+package org.jboss.shrinkwrap.api.mightmoveordelete;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* ArchiveFactory
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/JavaArchive.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/mightmoveordelete/JavaArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/JavaArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.mightmoveordelete;
+package org.jboss.shrinkwrap.api.mightmoveordelete;
import java.io.File;
import java.net.URL;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* JavaArchive
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/SecurityActions.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/mightmoveordelete/SecurityActions.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/SecurityActions.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.mightmoveordelete;
+package org.jboss.shrinkwrap.api.mightmoveordelete;
import java.lang.reflect.Constructor;
import java.security.AccessController;
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/VfsMemoryArchiveFactory.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/mightmoveordelete/VfsMemoryArchiveFactory.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/mightmoveordelete/VfsMemoryArchiveFactory.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.mightmoveordelete;
+package org.jboss.shrinkwrap.api.mightmoveordelete;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -23,7 +23,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* VfsMemoryArchiveFactory
Copied: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec (from rev 3512, declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/spec)
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchive.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/spec/EnterpriseArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/EnterpriseArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.spec;
+package org.jboss.shrinkwrap.api.spec;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.container.EnterpriseContainer;
-import org.jboss.declarchive.api.container.LibraryContainer;
-import org.jboss.declarchive.api.container.ManifestContainer;
-import org.jboss.declarchive.api.container.ResourceContainer;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.container.EnterpriseContainer;
+import org.jboss.shrinkwrap.api.container.LibraryContainer;
+import org.jboss.shrinkwrap.api.container.ManifestContainer;
+import org.jboss.shrinkwrap.api.container.ResourceContainer;
/**
* EnterpriseArchive
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchive.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/spec/JavaArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/JavaArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.spec;
+package org.jboss.shrinkwrap.api.spec;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.container.ClassContainer;
-import org.jboss.declarchive.api.container.ManifestContainer;
-import org.jboss.declarchive.api.container.ResourceContainer;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.container.ClassContainer;
+import org.jboss.shrinkwrap.api.container.ManifestContainer;
+import org.jboss.shrinkwrap.api.container.ResourceContainer;
/**
* JavaArchive
Modified: declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchive.java
===================================================================
--- declarchive/trunk/api/src/main/java/org/jboss/declarchive/api/spec/WebArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/api/src/main/java/org/jboss/shrinkwrap/api/spec/WebArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.api.spec;
+package org.jboss.shrinkwrap.api.spec;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.container.ClassContainer;
-import org.jboss.declarchive.api.container.LibraryContainer;
-import org.jboss.declarchive.api.container.ManifestContainer;
-import org.jboss.declarchive.api.container.ResourceContainer;
-import org.jboss.declarchive.api.container.WebContainer;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.container.ClassContainer;
+import org.jboss.shrinkwrap.api.container.LibraryContainer;
+import org.jboss.shrinkwrap.api.container.ManifestContainer;
+import org.jboss.shrinkwrap.api.container.ResourceContainer;
+import org.jboss.shrinkwrap.api.container.WebContainer;
/**
* WebArchive
Modified: declarchive/trunk/build/pom.xml
===================================================================
--- declarchive/trunk/build/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/build/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -16,11 +16,11 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive Build</name>
- <description>Declarchive Build Configuration</description>
+ <name>ShrinkWrap Build</name>
+ <description>ShrinkWrap Build Configuration</description>
<packaging>pom</packaging>
<!-- Properties -->
@@ -33,17 +33,18 @@
<!-- SCM -->
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/common/declarchive/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/common/declarchive/trunk</developerConnection>
- <url>http://anonsvn.jboss.org/repos/common/declarchive/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/common/shrinkwrap/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/common/shrinkwrap/trunk</developerConnection>
+ <url>http://anonsvn.jboss.org/repos/common/shrinkwrap/trunk</url>
</scm>
- <!--
- Issues TODO: Update this when we have a JIRA Key <issueManagement>
+ <!-- Issues -->
+ <issueManagement>
<system>jira</system>
- <url>http://jira.jboss.com/jira/browse/EMB</url> </issueManagement>
- -->
+ <url>http://jira.jboss.com/jira/browse/SHRINKWRAP</url>
+ </issueManagement>
+
<!-- Build -->
<build>
@@ -94,7 +95,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
- <tagBase>https://svn.jboss.org/repos/common/declarchive/tags</tagBase>
+ <tagBase>https://svn.jboss.org/repos/common/shrinkwrap/tags</tagBase>
</configuration>
</plugin>
Modified: declarchive/trunk/impl-base/pom.xml
===================================================================
--- declarchive/trunk/impl-base/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,17 +17,17 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-impl-base</artifactId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive Implementation Base</name>
- <description>Common Base for Implementations of the Declarchive Project</description>
+ <name>ShrinkWrap Implementation Base</name>
+ <description>Common Base for Implementations of the ShrinkWrap Project</description>
<!-- Properties -->
<properties>
<!-- Versioning -->
- <version.org.jboss.declarchive_declarchive.spi>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.spi>
+ <version.org.jboss.shrinkwrap_shrinkwrap.spi>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.spi>
</properties>
@@ -35,12 +35,12 @@
<dependencies>
<!--
- org.jboss.declarchive
+ org.jboss.shrinkwrap
-->
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-spi</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.spi}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-spi</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.spi}</version>
</dependency>
<!--
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ArchiveBase.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ArchiveBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,257 @@
+/*
+ * 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;
+
+import java.io.InputStream;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.AssetNotFoundException;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.export.ZipExporter;
+import org.jboss.shrinkwrap.impl.base.asset.ArchiveAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+
+/**
+ * ArchiveBase
+ *
+ * Base implementation of {@link Archive}. Contains
+ * support for operations (typically overloaded) that are
+ * not specific to any particular storage implementation,
+ * and may be delegated to other forms.
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public abstract class ArchiveBase<T extends Archive<T>> implements Archive<T>
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(ArchiveBase.class.getName());
+
+ //-------------------------------------------------------------------------------------||
+ // Instance Members -------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Name of the archive
+ */
+ private final String name;
+
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Constructor
+ *
+ * Creates a new Archive with the specified name
+ *
+ * @param name Name of the archive
+ * @throws IllegalArgumentException If the name was not specified
+ */
+ protected ArchiveBase(final String name) throws IllegalArgumentException
+ {
+ // Precondition checks
+ Validate.notNullOrEmpty(name, "name must be specified");
+
+ // Set
+ this.name = name;
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations -----------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#add(java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ */
+ @Override
+ public T add(final String target, final Asset asset) throws IllegalArgumentException
+ {
+ // Precondition checks
+ Validate.notNullOrEmpty(target, "target must be specified");
+ Validate.notNull(asset, "asset must be specified");
+
+ // Make a Path from the target
+ final Path path = new BasicPath(target);
+
+ // Delegate
+ return this.add(path, asset);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Path, java.lang.String, org.jboss.shrinkwrap.api.Asset)
+ */
+ @Override
+ public T add(final Path path, final String name, final Asset asset)
+ {
+ // Precondition checks
+ Validate.notNull(path, "No path was specified");
+ Validate.notNullOrEmpty(name, "No target name name was specified");
+ Validate.notNull(asset, "No asset was was specified");
+
+ // Make a relative path
+ final Path resolvedPath = new BasicPath(path, name);
+
+ // Delegate
+ return this.add(resolvedPath, asset);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#get(java.lang.String)
+ */
+ @Override
+ public Asset get(final String path) throws AssetNotFoundException, IllegalArgumentException
+ {
+ // Precondition checks
+ Validate.notNullOrEmpty(path, "No path was specified");
+
+ // Make a Path
+ final Path realPath = new BasicPath(path);
+
+ // Delegate
+ return get(realPath);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Archive)
+ */
+ @Override
+ public T add(final Path path, final Archive<?> archive)
+ {
+ // Precondition checks
+ Validate.notNull(path, "No path was specified");
+ Validate.notNull(archive, "No archive was specified");
+
+ // Make a Path
+ final String archiveName = archive.getName();
+ final Path contentPath = new BasicPath(path, archiveName);
+
+ // Get archive input stream
+ InputStream inputStream = ZipExporter.exportZip(archive);
+
+ // Get the bytes for the archive
+ byte[] archiveBytes = IOUtil.asByteArray(inputStream);
+
+ // Create ArchiveAsset
+ ArchiveAsset archiveAsset = new ArchiveAsset(archive, archiveBytes);
+
+ // Delegate
+ return add(contentPath, archiveAsset);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#getName()
+ */
+ public final String getName()
+ {
+ return name;
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#merge(org.jboss.shrinkwrap.api.Archive)
+ */
+ @Override
+ public T merge(final Archive<?> source) throws IllegalArgumentException
+ {
+ return merge(new BasicPath(), source);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.shrinkwrap.api.Archive#merge(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Archive)
+ */
+ @Override
+ public T merge(final Path path, final Archive<?> source) throws IllegalArgumentException
+ {
+ // Precondition checks
+ Validate.notNull(path, "No path was specified");
+ Validate.notNull(source, "No source archive was specified");
+
+ // Get existing contents from source archive
+ final Map<Path, Asset> sourceContent = source.getContent();
+ Validate.notNull(sourceContent, "Source archive content can not be null.");
+
+ // Add each asset from the source archive
+ for (final Entry<Path, Asset> contentEntry : sourceContent.entrySet())
+ {
+ final Asset asset = contentEntry.getValue();
+ Path assetPath = contentEntry.getKey();
+ if (path != null)
+ {
+ assetPath = new BasicPath(path, assetPath);
+ }
+ // Delegate
+ add(assetPath, asset);
+ }
+ return covariantReturn();
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Contracts --------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Returns the actual typed class for this instance, used in safe casting
+ * for covariant return types
+ *
+ * @return
+ */
+ protected abstract Class<T> getActualClass();
+
+ //-------------------------------------------------------------------------------------||
+ // Internal Helper Methods ------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Provides typesafe covariant return of this instance
+ */
+ protected final T covariantReturn()
+ {
+ try
+ {
+ return this.getActualClass().cast(this);
+ }
+ catch (final ClassCastException cce)
+ {
+ log.log(Level.SEVERE,
+ "The class specified by getActualClass is not a valid assignment target for this instance;"
+ + " developer error");
+ throw cce;
+ }
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ContainerBase.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ContainerBase.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ContainerBase.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ContainerBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,514 @@
+/*
+ * 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;
+
+import java.net.URL;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Logger;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.AssetNotFoundException;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.container.ClassContainer;
+import org.jboss.shrinkwrap.api.container.LibraryContainer;
+import org.jboss.shrinkwrap.api.container.ManifestContainer;
+import org.jboss.shrinkwrap.api.container.ResourceContainer;
+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.UrlAsset;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+
+/**
+ * ContainerBase
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ * @param <T>
+ */
+public abstract class ContainerBase<T extends Archive<T>> implements
+ Archive<T>, ManifestContainer<T>, ResourceContainer<T>, ClassContainer<T>, LibraryContainer<T>
+{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ private static final Logger log = Logger.getLogger(ContainerBase.class.getName());
+
+ //-------------------------------------------------------------------------------------||
+ // Instance Members -------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * The backing storage engine.
+ */
+ private final Archive<?> archive;
+
+ /**
+ * The exposed archive type.
+ */
+ private final Class<T> actualType;
+
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ protected ContainerBase(Class<T> actualType, Archive<?> archive)
+ {
+ Validate.notNull(actualType, "ActualType should be specified");
+ Validate.notNull(archive, "Archive should be specified");
+
+ this.actualType = actualType;
+ this.archive = archive;
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - Archive Delegation --------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Resource[])
+ */
+// @Override
+// public T add(Asset... assets)
+// {
+// archive.add(assets);
+// return covarientReturn();
+// }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Asset[])
+ */
+// @Override
+// public T add(Path path, Asset... assets)
+// {
+// archive.add(path, assets);
+// return covarientReturn();
+// }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Archive)
+ */
+ @Override
+ public T add(Path path, Archive<?> archive)
+ {
+ this.archive.add(path, archive);
+ return covarientReturn();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Asset)
+ */
+ @Override
+ public T add(Path target, Asset asset) throws IllegalArgumentException
+ {
+ archive.add(target, asset);
+ return covarientReturn();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, java.lang.String, org.jboss.declarchive.api.Asset)
+ */
+ @Override
+ public T add(Path path, String name, Asset asset)
+ {
+ archive.add(path, name, asset);
+ return covarientReturn();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#merge(org.jboss.declarchive.api.Archive)
+ */
+ @Override
+ public T merge(Archive<?> source) throws IllegalArgumentException
+ {
+ archive.merge(source);
+ return covarientReturn();
+ }
+
+ @Override
+ public T merge(Path path, Archive<?> source) throws IllegalArgumentException
+ {
+ archive.merge(path, source);
+ return covarientReturn();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(java.lang.String, org.jboss.declarchive.api.Asset)
+ */
+ @Override
+ public T add(String name, Asset asset)
+ {
+ archive.add(name, asset);
+ return covarientReturn();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#contains(org.jboss.declarchive.api.Path)
+ */
+ @Override
+ public boolean contains(Path path)
+ {
+ return archive.contains(path);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#delete(org.jboss.declarchive.api.Path)
+ */
+ @Override
+ public boolean delete(Path path)
+ {
+ return archive.delete(path);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#get(org.jboss.declarchive.api.Path)
+ */
+ @Override
+ public Asset get(Path path)
+ {
+ return archive.get(path);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#get(java.lang.String)
+ */
+ @Override
+ public Asset get(String path) throws AssetNotFoundException, IllegalArgumentException
+ {
+ return get(new BasicPath(path));
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#getContent()
+ */
+ @Override
+ public Map<Path, Asset> getContent()
+ {
+ return archive.getContent();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#getName()
+ */
+ @Override
+ public String getName()
+ {
+ return archive.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#toString(boolean)
+ */
+ @Override
+ public String toString(boolean verbose)
+ {
+ return archive.toString(verbose);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - ManifestContainer ---------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Manifest related
+ * resources.
+ *
+ * @return Base Path for the ManifestContainer resources
+ */
+ protected abstract Path getManinfestPath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ManifestContainer#setManifest(java.lang.String)
+ */
+ @Override
+ public final T setManifest(String resourceName)
+ {
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ return add(getManinfestPath(), "MANIFEST.MF", new ClassLoaderAsset(resourceName));
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ManifestContainer#addManifestResource(java.lang.String)
+ */
+ @Override
+ public final T addManifestResource(String resourceName)
+ {
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ // create the Asset
+ Asset asset = new ClassLoaderAsset(resourceName);
+ // relocate the asset, sub path to the container.
+ Path location = new BasicPath(getManinfestPath(), resourceName);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ManifestContainer#addManifestResource(org.jboss.declarchive.api.Path, java.lang.String)
+ */
+ @Override
+ public T addManifestResource(Path target, String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target should be specified");
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getManinfestPath(), target);
+ return add(location, asset);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - ResourceContainer ---------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Resource related
+ * resources.
+ *
+ * @return Base Path for the ResourceContainer resources
+ */
+ protected abstract Path getResourcePath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(java.lang.String)
+ */
+ @Override
+ public final T addResource(String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getResourcePath(), resourceName);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(java.lang.String, java.lang.String)
+ */
+ @Override
+ public final T addResource(String resourceName, String newName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName should be specified");
+ Validate.notNull(newName, "NewName should be specified");
+
+ Asset resource = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getResourcePath(), AssetUtil.getPathForClassloaderResource(resourceName));
+ return add(location, newName, resource);
+ };
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(org.jboss.declarchive.api.Path, java.lang.String)
+ */
+ @Override
+ public T addResource(Path target, String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target should be specified");
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getResourcePath(), target);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(org.jboss.declarchive.api.Path, java.lang.String, java.lang.ClassLoader)
+ */
+ @Override
+ public T addResource(Path target, String resourceName, ClassLoader classLoader) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target should be specified");
+ Validate.notNull(resourceName, "ResourceName should be specified");
+ Validate.notNull(classLoader, "ClassLoader should be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName, classLoader);
+ Path location = new BasicPath(getResourcePath(), target);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(org.jboss.declarchive.api.Path, java.net.URL)
+ */
+ @Override
+ public T addResource(Path target, URL resource) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target should be specified");
+ Validate.notNull(resource, "Resource should be specified");
+
+ Asset asset = new UrlAsset(resource);
+ Path location = new BasicPath(getResourcePath(), target);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ResourceContainer#addResource(java.net.URL)
+ */
+ @Override
+ public T addResource(URL resource) throws IllegalArgumentException
+ {
+ Validate.notNull(resource, "Location should be specified");
+
+ Asset asset = new UrlAsset(resource);
+ Path location = new BasicPath(getResourcePath(), AssetUtil.getFullPathForURLResource(resource));
+ return add(location, asset);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - ClassContainer ------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Class related
+ * resources.
+ *
+ * @return Base Path for the ClassContainer resources
+ */
+ protected abstract Path getClassesPath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ClassContainer#addClass(java.lang.Class)
+ */
+ @Override
+ public T addClass(Class<?> clazz) throws IllegalArgumentException
+ {
+ Validate.notNull(clazz, "Clazz must be specified");
+
+ return addClasses(clazz);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ClassContainer#addClasses(java.lang.Class<?>[])
+ */
+ public T addClasses(Class<?>... classes) throws IllegalArgumentException
+ {
+ Validate.notNull(classes, "Classes must be specified");
+
+ for(Class<?> clazz : classes)
+ {
+ Asset resource = new ClassAsset(clazz);
+ Path location = new BasicPath(getClassesPath(), AssetUtil.getFullPathForClassResource(clazz));
+ add(location, resource);
+ }
+ return covarientReturn();
+ };
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ClassContainer#addPackage(java.lang.Package)
+ */
+ @Override
+ public T addPackage(Package pack) throws IllegalArgumentException
+ {
+ Validate.notNull(pack, "Pack must be specified");
+
+ return addPackages(false, pack);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.ClassContainer#addPackages(boolean, java.lang.Package[])
+ */
+ @Override
+ public T addPackages(boolean recursive, Package... packages) throws IllegalArgumentException
+ {
+ Validate.notNull(packages, "Packages must be specified");
+
+ for(Package pack : packages)
+ {
+ URLPackageScanner scanner = new URLPackageScanner(
+ pack, recursive, Thread.currentThread().getContextClassLoader());
+ Set<Class<?>> classes = scanner.getClasses();
+ for(Class<?> clazz : classes)
+ {
+ Asset asset = new ClassAsset(clazz);
+ Path location = new BasicPath(getClassesPath(), AssetUtil.getFullPathForClassResource(clazz));
+ add(location, asset);
+ }
+ }
+ return covarientReturn();
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - LibraryContainer ----------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Library related
+ * resources.
+ *
+ * @return Base Path for the LibraryContainer resources
+ */
+ protected abstract Path getLibraryPath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.LibraryContainer#addLibrary(org.jboss.declarchive.api.Archive)
+ */
+ public T addLibrary(Archive<?> archive) throws IllegalArgumentException
+ {
+ Validate.notNull(archive, "Archive must be specified");
+
+ Map<Path, Asset> content = archive.getContent();
+ for(Map.Entry<Path, Asset> entry : content.entrySet())
+ {
+ Path location = new BasicPath(getLibraryPath(), entry.getKey());
+ add(location, entry.getValue());
+ }
+ return covarientReturn();
+ };
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.LibraryContainer#addLibrary(java.lang.String)
+ */
+ @Override
+ public T addLibrary(String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName must be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getLibraryPath(), resourceName);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.LibraryContainer#addLibrary(org.jboss.declarchive.api.Path, java.lang.String)
+ */
+ @Override
+ public T addLibrary(Path target, String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target must be specified");
+ Validate.notNull(resourceName, "ResourceName must be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getLibraryPath(), target);
+ return add(location, asset);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Internal Helper Methods ------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ protected T covarientReturn()
+ {
+ return getActualClass().cast(this);
+ }
+
+ protected Class<T> getActualClass()
+ {
+ return this.actualType;
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseArchiveFactoryImpl.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/EnterpriseArchiveFactoryImpl.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseArchiveFactoryImpl.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseArchiveFactoryImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,52 @@
+/*
+ * 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;
+
+import org.jboss.shrinkwrap.api.EnterpriseArchiveFactory;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.impl.base.spec.EnterpriseArchiveImpl;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
+
+/**
+ * EnterpriseArchiveFactoryImpl
+ *
+ * EnterpriseArchiveFactory implementation used to create {@link EnterpriseArchive} instances. Thread-safe.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public class EnterpriseArchiveFactoryImpl extends EnterpriseArchiveFactory
+{
+
+ /*
+ * {@inheritDoc}
+ * @see org.jboss.declarchive.api.EnterpriseArchiveFactory#doCreate(java.lang.String)
+ */
+ @Override
+ protected EnterpriseArchive doCreate(String archiveName)
+ {
+ // Create storage delegate
+ MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
+
+ // Create enterprise archive
+ EnterpriseArchive enterpriseArchive = new EnterpriseArchiveImpl(memoryMapArchive);
+
+ // Return archive
+ return enterpriseArchive;
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseContainerBase.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/EnterpriseContainerBase.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseContainerBase.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/EnterpriseContainerBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,144 @@
+/*
+ * 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;
+
+import java.util.logging.Logger;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.container.EnterpriseContainer;
+import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
+import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+
+/**
+ * EnterpriseContainerSupport
+ *
+ * Abstract class that helps implement the EnterpriseContainer.
+ * Used by specs that extends the EnterpriseContainer.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ * @param <T>
+ */
+public abstract class EnterpriseContainerBase<T extends Archive<T>>
+ extends ContainerBase<T>
+ implements EnterpriseContainer<T>
+{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ private static final Logger log = Logger.getLogger(EnterpriseContainerBase.class.getName());
+
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ protected EnterpriseContainerBase(Class<T> actualType, Archive<?> archive)
+ {
+ super(actualType, archive);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - EnterpriseContainer - Resources -------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Application related
+ * resources.
+ *
+ * @return Base Path for the EnterpriseContainer application resources
+ */
+ protected abstract Path getApplicationPath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.EnterpriseContainer#setApplicationXML(java.lang.String)
+ */
+ @Override
+ public T setApplicationXML(String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName must be specified");
+ return add(getApplicationPath(), "application.xml", new ClassLoaderAsset(resourceName));
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.EnterpriseContainer#addApplicationResource(org.jboss.declarchive.api.Path, java.lang.String)
+ */
+ @Override
+ public T addApplicationResource(Path target, String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target must be specified");
+ Validate.notNull(resourceName, "ResourceName must be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getApplicationPath(), target);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.EnterpriseContainer#addApplicationResource(java.lang.String)
+ */
+ @Override
+ public T addApplicationResource(String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName must be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getApplicationPath(), resourceName);
+ return add(location, asset);
+ }
+
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - EnterpriseContainer - Modules ---------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Module related
+ * resources.
+ *
+ * @return Base Path for the EnterpriseContainer module resources
+ */
+ protected abstract Path getModulePath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.EnterpriseContainer#addModule(org.jboss.declarchive.api.Archive)
+ */
+ @Override
+ public T addModule(Archive<?> archive) throws IllegalArgumentException
+ {
+ Validate.notNull(archive, "Archive must be specified");
+
+ Path location = getModulePath();
+ return add(location, archive);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.EnterpriseContainer#addModule(java.lang.String)
+ */
+ @Override
+ public T addModule(String resourceName)
+ {
+ Validate.notNull(resourceName, "ResourceName must be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getModulePath(), AssetUtil.getNameForClassloaderResource(resourceName));
+ return add(location, asset);
+ }
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/JavaArchiveFactoryImpl.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/JavaArchiveFactoryImpl.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/JavaArchiveFactoryImpl.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/JavaArchiveFactoryImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,52 @@
+/*
+ * 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;
+
+import org.jboss.shrinkwrap.api.JavaArchiveFactory;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.spec.JavaArchiveImpl;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
+
+/**
+ * JavaArchiveFactoryImpl
+ *
+ * JavaArchiveFactory implementation used to create {@link JavaArchive} instances. Thread-safe.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public class JavaArchiveFactoryImpl extends JavaArchiveFactory
+{
+
+ /*
+ * {@inheritDoc}
+ * @see org.jboss.declarchive.api.JavaArchiveFactory#doCreate(java.lang.String)
+ */
+ @Override
+ protected JavaArchive doCreate(String archiveName)
+ {
+ // Create storage delegate
+ MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
+
+ // Create Java Archive
+ JavaArchive javaArchive = new JavaArchiveImpl(memoryMapArchive);
+
+ // Return archive
+ return javaArchive;
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/MemoryMapArchiveBase.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,170 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Logger;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+
+/**
+ * MemoryMapArchiveBase
+ *
+ * A base implementation for all MemoryMap archives. Thread-safe.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ * @param <T>
+ */
+public abstract class MemoryMapArchiveBase<T extends Archive<T>> extends ArchiveBase<T> implements Archive<T>
+{
+
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Logger
+ */
+ private static final Logger log = Logger.getLogger(MemoryMapArchiveBase.class.getName());
+
+ //-------------------------------------------------------------------------------------||
+ // Instance Members -------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Storage for the {@link Asset}s.
+ */
+ private final Map<Path, Asset> content = new ConcurrentHashMap<Path, Asset>();
+
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Constructor
+ *
+ * This constructor will generate a
+ * unique {@link Archive#getName()} per instance.
+ *
+ * @param actualType The {@link Archive} type.
+ */
+ public MemoryMapArchiveBase()
+ {
+ this("Archive-" + UUID.randomUUID().toString() + ".jar");
+ }
+
+ /**
+ * Constructor
+ *
+ * This constructor will generate an {@link Archive} with the provided name.
+ *
+ * @param archiveName
+ */
+ public MemoryMapArchiveBase(final String archiveName)
+ {
+ super(archiveName);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - Archive -------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Asset[])
+ */
+ @Override
+ public T add(Path path, Asset asset)
+ {
+ Validate.notNull(path, "No path was specified");
+ Validate.notNull(asset, "No asset was specified");
+
+ content.put(path, asset);
+ return covariantReturn();
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#contains(org.jboss.declarchive.api.Path)
+ */
+ @Override
+ public boolean contains(Path path)
+ {
+ Validate.notNull(path, "No path was specified");
+ return content.containsKey(path);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#delete(org.jboss.declarchive.api.Path)
+ */
+ @Override
+ public boolean delete(Path path)
+ {
+ Validate.notNull(path, "No path was specified");
+ return content.remove(path) != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#get(org.jboss.declarchive.api.Path)
+ */
+ @Override
+ public Asset get(Path path)
+ {
+ Validate.notNull(path, "No path was specified");
+ return content.get(path);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#getContent()
+ */
+ @Override
+ public Map<Path, Asset> getContent()
+ {
+ return Collections.unmodifiableMap(content);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.Archive#toString(boolean)
+ */
+ @Override
+ public String toString(boolean verbose)
+ {
+ // If we want verbose output
+ if (verbose)
+ {
+ StringBuilder sb = new StringBuilder();
+ List<Path> paths = new ArrayList<Path>(content.keySet());
+ Collections.sort(paths);
+
+ for (Path path : paths)
+ {
+ sb.append(path.get()).append('\n');
+ }
+ return sb.toString();
+ }
+ // Fall back on toString
+ return this.toString();
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveImpl.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/MemoryMapArchiveImpl.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveImpl.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/MemoryMapArchiveImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,72 @@
+/*
+ * 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;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
+
+/**
+ * MemoryMapArchiveImpl
+ *
+ * A default implementation for all MemoryMap archives. Thread-safe.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ * @param <T>
+ */
+public class MemoryMapArchiveImpl extends MemoryMapArchiveBase<MemoryMapArchive> implements MemoryMapArchive
+{
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Constructor
+ *
+ * This constructor will generate a
+ * unique {@link Archive#getName()} per instance.
+ *
+ * @param actualType The {@link Archive} type.
+ */
+ public MemoryMapArchiveImpl()
+ {
+ super();
+ }
+
+ /**
+ * Constructor
+ *
+ * This constructor will generate an {@link Archive} with the provided name.
+ *
+ * @param archiveName
+ */
+ public MemoryMapArchiveImpl(String archiveName)
+ {
+ super(archiveName);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.declarchive.impl.base.MemoryMapArchiveBase#getActualClass()
+ */
+ @Override
+ protected Class<MemoryMapArchive> getActualClass()
+ {
+ return MemoryMapArchive.class;
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ResourceNotFoundException.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/ResourceNotFoundException.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ResourceNotFoundException.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/ResourceNotFoundException.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,63 @@
+/*
+ * 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;
+
+/**
+ * ResourceNotFoundException
+ *
+ * Thrown when a resource is requested, but could not be found
+ * within the context of the given ClassLoader
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+public class ResourceNotFoundException extends IllegalArgumentException
+{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+
+ //-------------------------------------------------------------------------------------||
+ // Constructors -----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ public ResourceNotFoundException()
+ {
+ super();
+ }
+
+ public ResourceNotFoundException(final String message, final Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public ResourceNotFoundException(final String s)
+ {
+ super(s);
+ }
+
+ public ResourceNotFoundException(final Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/SecurityActions.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/SecurityActions.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/SecurityActions.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/SecurityActions.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,63 @@
+/*
+ * 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;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+/**
+ * SecurityActions
+ *
+ * A set of privileged actions that are not to leak out
+ * of this package
+ *
+ * @author <a href="mailto:andrew.rubinger at jboss.org">ALR</a>
+ * @version $Revision: $
+ */
+final class SecurityActions
+{
+
+ //-------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * No external instanciation
+ */
+ private SecurityActions()
+ {
+
+ }
+
+ //-------------------------------------------------------------------------------||
+ // Utility Methods --------------------------------------------------------------||
+ //-------------------------------------------------------------------------------||
+
+ /**
+ * Obtains the Thread Context ClassLoader
+ */
+ static ClassLoader getThreadContextClassLoader()
+ {
+ return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>()
+ {
+ public ClassLoader run()
+ {
+ return Thread.currentThread().getContextClassLoader();
+ }
+ });
+ }
+}
Property changes on: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/SecurityActions.java
___________________________________________________________________
Name: svn:executable
+ *
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/URLPackageScanner.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/URLPackageScanner.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,175 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipException;
+import java.util.zip.ZipFile;
+
+/**
+ * Implementation of scanner which can scan a {@link URLClassLoader}
+ *
+ * @author Thomas Heute
+ * @author Gavin King
+ * @author Norman Richards
+ * @author Pete Muir
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ */
+public class URLPackageScanner
+{
+
+ private static final Logger log = Logger.getLogger(URLPackageScanner.class.getName());
+
+ private final String packageName;
+
+ private final String packageNamePath;
+
+ private final boolean addRecursively;
+
+ private final ClassLoader classLoader;
+
+ private final Set<Class<?>> classes = new HashSet<Class<?>>();
+
+ public URLPackageScanner(Package pkg, boolean addRecursively, ClassLoader classLoader)
+ {
+ this(pkg.getName(), addRecursively, classLoader);
+ }
+
+ public URLPackageScanner(String packageName, boolean addRecursively, ClassLoader classLoader)
+ {
+ Validate.notNull(packageName, "PackageName must be specified");
+ Validate.notNull(addRecursively, "AddRecursively must be specified");
+ Validate.notNull(classLoader, "ClassLoader must be specified");
+
+ this.packageName = packageName;
+ this.packageNamePath = packageName.replace(".", "/");
+ this.addRecursively = addRecursively;
+ this.classLoader = classLoader;
+ }
+
+ private void scanPackage()
+ {
+ try
+ {
+ Set<String> paths = new HashSet<String>();
+
+ for (URL url : loadResources(packageNamePath))
+ {
+ String urlPath = url.getFile();
+ urlPath = URLDecoder.decode(urlPath, "UTF-8");
+ if (urlPath.startsWith("file:"))
+ {
+ urlPath = urlPath.substring(5);
+ }
+ if (urlPath.indexOf('!') > 0)
+ {
+ urlPath = urlPath.substring(0, urlPath.indexOf('!'));
+ }
+ paths.add(urlPath);
+ }
+ handle(paths);
+ }
+ catch (IOException ioe)
+ {
+ log.log(Level.WARNING, "could not read: " + packageName, ioe);
+ }
+ catch (ClassNotFoundException ioe)
+ {
+ log.log(Level.WARNING, "Class coud not be loaded in package: " + packageName, ioe);
+ }
+ }
+
+ private void handleArchiveByFile(File file) throws IOException, ClassNotFoundException
+ {
+ try
+ {
+ log.fine("archive: " + file);
+ ZipFile zip = new ZipFile(file);
+ Enumeration<? extends ZipEntry> entries = zip.entries();
+ while (entries.hasMoreElements())
+ {
+ ZipEntry entry = entries.nextElement();
+ String name = entry.getName();
+ if (name.startsWith(packageNamePath) && name.endsWith(".class")
+ && (addRecursively || !name.substring(packageNamePath.length() + 1).contains("/")))
+ {
+ String className = name.replace("/", ".").replace(".class", "");
+ classes.add(classLoader.loadClass(className));
+ }
+ }
+ }
+ catch (ZipException e)
+ {
+ throw new RuntimeException("Error handling file " + file, e);
+ }
+ }
+
+ private void handle(Set<String> paths) throws IOException, ClassNotFoundException
+ {
+ for (String urlPath : paths)
+ {
+ log.fine("scanning: " + urlPath);
+ File file = new File(urlPath);
+ if (file.isDirectory())
+ {
+ handle(file, packageName);
+ }
+ else
+ {
+ handleArchiveByFile(file);
+ }
+ }
+ }
+
+ private void handle(File file, String packageName) throws ClassNotFoundException
+ {
+ for (File child : file.listFiles())
+ {
+ if (!child.isDirectory() && child.getName().endsWith(".class"))
+ {
+ classes.add(classLoader.loadClass(packageName + "." + child.getName().substring(0, child.getName().lastIndexOf(".class"))));
+ }
+ else if (child.isDirectory() && addRecursively)
+ {
+ handle(child, packageName + "." + child.getName());
+ }
+ }
+ }
+
+ public List<URL> loadResources(String name) throws IOException
+ {
+ return Collections.list(classLoader.getResources(name));
+ }
+
+ public Set<Class<?>> getClasses()
+ {
+ scanPackage();
+ return classes;
+ }
+}
\ No newline at end of file
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/Validate.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/Validate.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/Validate.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/Validate.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,63 @@
+/*
+ * 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;
+
+/**
+ * Validate
+ *
+ * Validation utility
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public final class Validate
+{
+ private Validate()
+ {
+ }
+
+ /**
+ * Checks that object is not null, throws exception if it is.
+ *
+ * @param obj The object to check
+ * @param message The exception message
+ * @throws IllegalArgumentException Thrown if obj is null
+ */
+ public static void notNull(final Object obj, final String message) throws IllegalArgumentException
+ {
+ if (obj == null)
+ {
+ throw new IllegalArgumentException(message);
+ }
+ }
+
+ /**
+ * Checks that the specified String is not null or empty,
+ * throws exception if it is.
+ *
+ * @param string The object to check
+ * @param message The exception message
+ * @throws IllegalArgumentException Thrown if obj is null
+ */
+ public static void notNullOrEmpty(final String string, final String message) throws IllegalArgumentException
+ {
+ if (string == null || string.length() == 0)
+ {
+ throw new IllegalArgumentException(message);
+ }
+ }
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebArchiveFactoryImpl.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/WebArchiveFactoryImpl.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebArchiveFactoryImpl.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebArchiveFactoryImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,52 @@
+/*
+ * 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;
+
+import org.jboss.shrinkwrap.api.WebArchiveFactory;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.impl.base.spec.WebArchiveImpl;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
+
+/**
+ * WebArchiveFactoryImpl
+ *
+ * WebArchiveFactory implementation used to create {@link WebArchive} instances. Thread-safe.
+ *
+ * @author <a href="mailto:baileyje at gmail.com">John Bailey</a>
+ * @version $Revision: $
+ */
+public class WebArchiveFactoryImpl extends WebArchiveFactory
+{
+
+ /*
+ * {@inheritDoc}
+ * @see org.jboss.declarchive.api.WebArchiveFactory#doCreate(java.lang.String)
+ */
+ @Override
+ protected WebArchive doCreate(String archiveName)
+ {
+ // Create storage delegate
+ MemoryMapArchive memoryMapArchive = new MemoryMapArchiveImpl(archiveName);
+
+ // Create web archive
+ WebArchive webArchive = new WebArchiveImpl(memoryMapArchive);
+
+ // Return archive
+ return webArchive;
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebContainerBase.java (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/WebContainerBase.java)
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebContainerBase.java (rev 0)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/WebContainerBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,106 @@
+/*
+ * 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;
+
+import java.util.logging.Logger;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.container.WebContainer;
+import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+
+/**
+ * WebContainerBase
+ *
+ * Abstract class that helps implement the WebContainer.
+ * Used by specs that extends the WebContainer.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ * @param <T>
+ */
+public abstract class WebContainerBase<T extends Archive<T>>
+ extends ContainerBase<T>
+ implements WebContainer<T>
+{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ private static final Logger log = Logger.getLogger(WebContainerBase.class.getName());
+
+ //-------------------------------------------------------------------------------------||
+ // Constructor ------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ protected WebContainerBase(Class<T> actualType, Archive<?> archive)
+ {
+ super(actualType, archive);
+ }
+
+ //-------------------------------------------------------------------------------------||
+ // Required Implementations - WebContainer --------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
+ * Should be implemented to set the path for Manifest related
+ * resources.
+ *
+ * @return Base Path for the ManifestContainer resources
+ */
+ protected abstract Path getWebPath();
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.WebContainer#setWebXML(java.lang.String)
+ */
+ @Override
+ public T setWebXML(String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName should be specified");
+ return add(getWebPath(), "web.xml", new ClassLoaderAsset(resourceName));
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.WebContainer#addWebResource(org.jboss.declarchive.api.Path, java.lang.String)
+ */
+ @Override
+ public T addWebResource(Path target, String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(target, "Target should be specified");
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getWebPath(), target);
+ return add(location, asset);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.declarchive.api.container.WebContainer#addWebResource(java.lang.String)
+ */
+ @Override
+ public T addWebResource(String resourceName) throws IllegalArgumentException
+ {
+ Validate.notNull(resourceName, "ResourceName should be specified");
+
+ Asset asset = new ClassLoaderAsset(resourceName);
+ Path location = new BasicPath(getWebPath(), resourceName);
+ return add(location, asset);
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset)
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ArchiveAsset.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/ArchiveAsset.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ArchiveAsset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,11 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* ArchiveAsset
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/AssetUtil.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtil.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.net.URL;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
/**
* AssetUtil
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAsset.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/ByteArrayAsset.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ByteArrayAsset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+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.declarchive.api.Asset;
-import org.jboss.declarchive.impl.base.Validate;
-import org.jboss.declarchive.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.Validate;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
/**
* ByteArrayAsset
@@ -96,7 +96,7 @@
//-------------------------------------------------------------------------------------||
/**
- * @see org.jboss.declarchive.api.Asset#getStream()
+ * @see org.jboss.shrinkwrap.api.Asset#getStream()
*/
@Override
public InputStream getStream()
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ClassAsset.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/ClassAsset.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ClassAsset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.InputStream;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* ClassAsset
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ClassLoaderAsset.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/ClassLoaderAsset.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/ClassLoaderAsset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.InputStream;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* ClassloaderAsset
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/FileAsset.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/FileAsset.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/FileAsset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* FileAsset
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/SecurityActions.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/SecurityActions.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/SecurityActions.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.security.AccessController;
import java.security.PrivilegedAction;
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/UrlAsset.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/asset/UrlAsset.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/asset/UrlAsset.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.InputStream;
import java.net.URL;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* UrlAsset
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/export)
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/AbstractExporterDelegate.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/export/AbstractExporterDelegate.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/AbstractExporterDelegate.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
/**
* AbstractExporterDelegate
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterDelegate.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/export/ExplodedExporterDelegate.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterDelegate.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.File;
import java.io.FileOutputStream;
@@ -22,13 +22,13 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.export.ArchiveExportException;
-import org.jboss.declarchive.api.export.ExplodedExporter;
-import org.jboss.declarchive.impl.base.asset.ArchiveAsset;
-import org.jboss.declarchive.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.export.ArchiveExportException;
+import org.jboss.shrinkwrap.api.export.ExplodedExporter;
+import org.jboss.shrinkwrap.impl.base.asset.ArchiveAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
/**
* ExplodedExporterDelegate
@@ -77,7 +77,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.impl.base.export.AbstractExporterDelegate#processAsset(Path, Asset)
+ * @see org.jboss.shrinkwrap.impl.base.export.AbstractExporterDelegate#processAsset(Path, Asset)
*/
@Override
protected void processAsset(Path path, Asset asset)
@@ -127,7 +127,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.impl.base.export.AbstractExporterDelegate#getResult()
+ * @see org.jboss.shrinkwrap.impl.base.export.AbstractExporterDelegate#getResult()
*/
@Override
protected File getResult()
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterImpl.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/export/ExplodedExporterImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.File;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.export.ExplodedExporter;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.export.ExplodedExporter;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* ExplodedExporterImpl
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ZipExportDelegate.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/export/ZipExportDelegate.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ZipExportDelegate.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -25,11 +25,11 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.export.ArchiveExportException;
-import org.jboss.declarchive.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.export.ArchiveExportException;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
public class ZipExportDelegate extends AbstractExporterDelegate<InputStream>
{
@@ -74,7 +74,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.impl.base.export.AbstractExporterDelegate#export()
+ * @see org.jboss.shrinkwrap.impl.base.export.AbstractExporterDelegate#export()
*/
@Override
protected InputStream export()
@@ -98,7 +98,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.impl.base.export.AbstractExporterDelegate#processAsset(Path, Asset)
+ * @see org.jboss.shrinkwrap.impl.base.export.AbstractExporterDelegate#processAsset(Path, Asset)
*/
@Override
protected void processAsset(Path path, Asset asset)
@@ -140,7 +140,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.impl.base.export.AbstractExporterDelegate#getResult()
+ * @see org.jboss.shrinkwrap.impl.base.export.AbstractExporterDelegate#getResult()
*/
@Override
protected InputStream getResult()
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterImpl.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/export/ZipExporterImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.InputStream;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.export.ZipExporter;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.export.ZipExporter;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* ZipExporterImpl
@@ -50,7 +50,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.export.ZipExporter#doExportZip(org.jboss.declarchive.api.Archive)
+ * @see org.jboss.shrinkwrap.api.export.ZipExporter#doExportZip(org.jboss.shrinkwrap.api.Archive)
*/
@Override
protected InputStream doExportZip(Archive<?> archive)
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/io)
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/io/IOUtil.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/io/IOUtil.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.io;
+package org.jboss.shrinkwrap.impl.base.io;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -22,7 +22,7 @@
import java.io.InputStream;
import java.io.OutputStream;
-import org.jboss.declarchive.impl.base.Validate;
+import org.jboss.shrinkwrap.impl.base.Validate;
/**
* IOUtil
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/path)
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/BasicPath.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/path/BasicPath.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/BasicPath.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.path;
+package org.jboss.shrinkwrap.impl.base.path;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Path;
/**
* BasicPath
@@ -124,7 +124,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Path#get()
+ * @see org.jboss.shrinkwrap.api.Path#get()
*/
@Override
public String get()
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/PathUtil.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/path/PathUtil.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/path/PathUtil.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.path;
+package org.jboss.shrinkwrap.impl.base.path;
/**
* PathUtil
Copied: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec (from rev 3512, declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/spec)
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImpl.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/spec/EnterpriseArchiveImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.spec;
+package org.jboss.shrinkwrap.impl.base.spec;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.spec.EnterpriseArchive;
-import org.jboss.declarchive.impl.base.EnterpriseContainerBase;
-import org.jboss.declarchive.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.impl.base.EnterpriseContainerBase;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
/**
* EnterpriseArchiveImpl
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImpl.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/spec/JavaArchiveImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.spec;
+package org.jboss.shrinkwrap.impl.base.spec;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.spec.JavaArchive;
-import org.jboss.declarchive.impl.base.ContainerBase;
-import org.jboss.declarchive.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.ContainerBase;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
/**
* JavaArchiveImpl
Modified: declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImpl.java
===================================================================
--- declarchive/trunk/impl-base/src/main/java/org/jboss/declarchive/impl/base/spec/WebArchiveImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.spec;
+package org.jboss.shrinkwrap.impl.base.spec;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.spec.WebArchive;
-import org.jboss.declarchive.impl.base.WebContainerBase;
-import org.jboss.declarchive.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.impl.base.WebContainerBase;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
/**
* WebArchiveImpl
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset)
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtilTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset/AssetUtilTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/AssetUtilTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.net.URL;
import junit.framework.Assert;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
import org.junit.Test;
@@ -35,7 +36,7 @@
*/
public class AssetUtilTestCase
{
- private static final String EXISTING_RESOURCE = "org/jboss/declarchive/impl/base/asset/Test.properties";
+ private static final String EXISTING_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
@Test
public void shouldBeAbleToGetPathForClassloaderResource() throws Exception
@@ -44,7 +45,7 @@
Assert.assertEquals(
"The classloader resource path should not contain the file name",
- new BasicPath("org/jboss/declarchive/impl/base/asset"),
+ new BasicPath("org/jboss/shrinkwrap/impl/base/asset"),
foundResourcePath);
}
@@ -66,7 +67,7 @@
Assert.assertEquals(
"The class resource should have a / delimiter and a .class extension",
- new BasicPath("/org/jboss/declarchive/impl/base/asset/AssetUtilTestCase.class"),
+ new BasicPath("/org/jboss/shrinkwrap/impl/base/asset/AssetUtilTestCase.class"),
foundClassResourcePath);
}
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ClassAssetTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset/ClassAssetTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ClassAssetTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,11 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.InputStream;
-import org.jboss.declarchive.api.Asset;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.asset.ClassAsset;
import org.junit.Assert;
import org.junit.Test;
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ClassLoaderAssetTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset/ClassLoaderAssetTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/ClassLoaderAssetTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.InputStream;
import junit.framework.Assert;
-import org.jboss.declarchive.api.Asset;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
import org.junit.Test;
/**
@@ -33,9 +34,9 @@
*/
public class ClassLoaderAssetTestCase
{
- private static final String EXISTING_RESOURCE = "org/jboss/declarchive/impl/base/asset/Test.properties";
+ private static final String EXISTING_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
- private static final String NON_EXISTING_RESOURCE = "org/jboss/declarchive/impl/base/asset/NoFileShouldBePlacedHere.properties";
+ private static final String NON_EXISTING_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/NoFileShouldBePlacedHere.properties";
@Test
public void shouldBeAbleToReadResource() throws Exception
@@ -44,7 +45,7 @@
InputStream io = asset.getStream();
Assert.assertNotNull(io);
- Assert.assertEquals("Should be able to read the content of the resource", "declarch=true", TestUtils
+ Assert.assertEquals("Should be able to read the content of the resource", "shrinkwrap=true", TestUtils
.convertToString(io));
}
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/FileAssetTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset/FileAssetTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/FileAssetTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,14 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.File;
import java.io.InputStream;
import junit.framework.Assert;
-import org.jboss.declarchive.api.Asset;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.impl.base.asset.FileAsset;
import org.junit.Test;
/**
@@ -34,7 +35,7 @@
*/
public class FileAssetTestCase
{
- private static final String BASE_PATH = "src/test/resources/org/jboss/declarchive/impl/base/asset/";
+ private static final String BASE_PATH = "src/test/resources/org/jboss/shrinkwrap/impl/base/asset/";
private static final String EXISTING_FILE = BASE_PATH + "Test.properties";
@@ -47,7 +48,7 @@
InputStream io = asset.getStream();
Assert.assertNotNull(io);
- Assert.assertEquals("Should be able to read the content of the resource", "declarch=true", TestUtils
+ Assert.assertEquals("Should be able to read the content of the resource", "shrinkwrap=true", TestUtils
.convertToString(io));
}
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/TestUtils.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset/TestUtils.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/TestUtils.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/UrlAssetTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/asset/UrlAssetTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/asset/UrlAssetTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.asset;
+package org.jboss.shrinkwrap.impl.base.asset;
import java.io.InputStream;
import junit.framework.Assert;
-import org.jboss.declarchive.api.Asset;
+import org.jboss.shrinkwrap.api.Asset;
import org.junit.Test;
/**
@@ -33,7 +33,7 @@
*/
public class UrlAssetTestCase
{
- private static final String EXISTING_RESOURCE = "org/jboss/declarchive/impl/base/asset/Test.properties";
+ private static final String EXISTING_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
@Test
public void shouldBeAbleToReadURL() throws Exception
@@ -43,7 +43,7 @@
InputStream io = asset.getStream();
Assert.assertNotNull(io);
- Assert.assertEquals("Should be able to read the content of the resource", "declarch=true", TestUtils
+ Assert.assertEquals("Should be able to read the content of the resource", "shrinkwrap=true", TestUtils
.convertToString(io));
}
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/export)
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/export/ExplodedExporterTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExplodedExporterTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.File;
import java.io.FileInputStream;
@@ -23,14 +23,14 @@
import java.io.InputStream;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.export.ExplodedExporter;
-import org.jboss.declarchive.impl.base.MemoryMapArchiveImpl;
-import org.jboss.declarchive.impl.base.asset.ClassLoaderAsset;
-import org.jboss.declarchive.impl.base.io.IOUtil;
-import org.jboss.declarchive.impl.base.path.BasicPath;
-import org.jboss.declarchive.spi.MemoryMapArchive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.export.ExplodedExporter;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
import org.junit.Assert;
import org.junit.Test;
@@ -54,6 +54,16 @@
*/
private static final Logger log = Logger.getLogger(ExplodedExporterTestCase.class.getName());
+ /**
+ * Name of a properties file upon the test CP
+ */
+ private static final String NAME_TEST_PROPERTIES = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
+
+ /**
+ * Name of another properties file upon the test CP
+ */
+ private static final String NAME_TEST_PROPERTIES_2 = "org/jboss/shrinkwrap/impl/base/asset/Test2.properties";
+
//-------------------------------------------------------------------------------------||
// Tests ------------------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
@@ -75,10 +85,10 @@
MemoryMapArchive archive = new MemoryMapArchiveImpl("testArchive.jar");
// Add some content
- Asset assetOne = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset assetOne = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path pathOne = new BasicPath("test.properties");
archive.add(pathOne, assetOne);
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
Path pathTwo = new BasicPath("nested", "test2.properties");
archive.add(pathTwo, assetTwo);
@@ -118,13 +128,13 @@
MemoryMapArchive nestedArchive = new MemoryMapArchiveImpl("nestedArchive.jar");
// Add some content
- Asset assetOne = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset assetOne = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path pathOne = new BasicPath("test.properties");
nestedArchive.add(pathOne, assetOne);
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
Path pathTwo = new BasicPath("nested", "test2.properties");
nestedArchive.add(pathTwo, assetTwo);
-
+
archive.add(new BasicPath(), nestedArchive);
// Add an archive nested in a directory
@@ -152,7 +162,7 @@
assertAssetInExploded(explodedDirectory, new BasicPath(nestedArchivePath, pathOne), assetOne);
assertAssetInExploded(explodedDirectory, new BasicPath(nestedArchivePath, pathTwo), assetTwo);
-
+
Path nestedArchivePathTwo = new BasicPath(nestedPath, nestedArchiveTwo.getName());
assertAssetInExploded(explodedDirectory, new BasicPath(nestedArchivePathTwo, pathOne), assetOne);
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/export/ExportTestBase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ExportTestBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.File;
import java.net.URISyntaxException;
import java.util.logging.Logger;
-import org.jboss.declarchive.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
import org.junit.Assert;
/**
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/export/ZipExporterTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/export/ZipExporterTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.export;
+package org.jboss.shrinkwrap.impl.base.export;
import java.io.File;
import java.io.FileOutputStream;
@@ -25,15 +25,15 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.api.export.ZipExporter;
-import org.jboss.declarchive.impl.base.MemoryMapArchiveImpl;
-import org.jboss.declarchive.impl.base.asset.ClassLoaderAsset;
-import org.jboss.declarchive.impl.base.io.IOUtil;
-import org.jboss.declarchive.impl.base.path.BasicPath;
-import org.jboss.declarchive.spi.MemoryMapArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.export.ZipExporter;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
import org.junit.Assert;
import org.junit.Test;
@@ -55,7 +55,17 @@
* Logger
*/
private static final Logger log = Logger.getLogger(ZipExporterTestCase.class.getName());
+
+ /**
+ * Name of a properties file upon the test CP
+ */
+ private static final String NAME_TEST_PROPERTIES = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
+ /**
+ * Name of another properties file upon the test CP
+ */
+ private static final String NAME_TEST_PROPERTIES_2 = "org/jboss/shrinkwrap/impl/base/asset/Test2.properties";
+
//-------------------------------------------------------------------------------------||
// Tests ------------------------------------------------------------------------------||
//-------------------------------------------------------------------------------------||
@@ -76,10 +86,10 @@
MemoryMapArchive archive = new MemoryMapArchiveImpl("testArchive.jar");
// Add some content
- Asset assetOne = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset assetOne = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path pathOne = new BasicPath("test.properties");
archive.add(pathOne, assetOne);
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
Path pathTwo = new BasicPath("nested", "test2.properties");
archive.add(pathTwo, assetTwo);
@@ -111,10 +121,10 @@
MemoryMapArchive archive = new MemoryMapArchiveImpl("testArchive.jar");
// Add some content
- Asset assetOne = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset assetOne = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path pathOne = new BasicPath("test.properties");
archive.add(pathOne, assetOne);
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path pathTwo = new BasicPath("nested", "test2.properties");
archive.add(pathTwo, assetTwo);
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/path)
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/BasicPathTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/path/BasicPathTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/BasicPathTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,11 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.path;
+package org.jboss.shrinkwrap.impl.base.path;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Path;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.impl.base.path.PathUtil;
import org.junit.Assert;
import org.junit.Test;
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/PathUtilTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/path/PathUtilTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/path/PathUtilTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -1,7 +1,8 @@
-package org.jboss.declarchive.impl.base.path;
+package org.jboss.shrinkwrap.impl.base.path;
import java.util.logging.Logger;
+import org.jboss.shrinkwrap.impl.base.path.PathUtil;
import org.junit.Assert;
import org.junit.Test;
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImplTestCase.java (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/spec/EnterpriseArchiveImplTestCase.java)
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImplTestCase.java (rev 0)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/EnterpriseArchiveImplTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,148 @@
+/*
+ * 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.spec;
+
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.impl.base.spec.EnterpriseArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.spec.JavaArchiveImpl;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * EnterpriseArchiveImplTest
+ *
+ * Test to ensure that EnterpriseArchiveImpl follow to java ear spec.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class EnterpriseArchiveImplTestCase
+{
+ private static final String TEST_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
+
+ private static final Path PATH_APPLICATION = new BasicPath("META-INF");
+
+ private static final Path PATH_LIBRARY = new BasicPath("lib");
+
+ private static final Path PATH_MODULE = new BasicPath("/");
+
+ private EnterpriseArchive archive;
+
+ @Before
+ public void createWebArchive() throws Exception
+ {
+ archive = new EnterpriseArchiveImpl(new MemoryMapArchiveImpl());
+ }
+
+ @After
+ public void ls()
+ {
+ System.out.println("test at jboss:/$ ls -l " + archive.getName());
+ System.out.println(archive.toString(true));
+ }
+
+ @Test
+ public void shouldBeAbleToAddApplicationXML() throws Exception
+ {
+ archive.setApplicationXML(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_APPLICATION, "application.xml");
+
+ Assert.assertTrue(
+ "applicaton.xml should be located in /META-INF/application.xml",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddApplicationResource() throws Exception
+ {
+ archive.addApplicationResource(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_APPLICATION, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A application resource should be located in /META-INF/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddApplicationResourceWithNewName() throws Exception
+ {
+ String newName = "test.txt";
+ archive.addApplicationResource(new BasicPath(newName), TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_APPLICATION, newName);
+
+ Assert.assertTrue(
+ "A application resource should be located in /META-INF/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddLibrary() throws Exception
+ {
+ archive.addLibrary(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_LIBRARY, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A library should be located in /lib/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddModule() throws Exception
+ {
+ archive.addModule(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(
+ PATH_MODULE,
+ AssetUtil.getNameForClassloaderResource(TEST_RESOURCE));
+
+ Assert.assertTrue(
+ "A application module should be located in /",
+ archive.contains(expectedPath));
+ }
+
+ //@Test
+ // TODO: should we be able to add a ArchiveAsset, to add aarchive as a single jar not a exploded jar?
+ public void shouldBeAbleToAddArchiveModule() throws Exception
+ {
+ JavaArchive moduleArchive = new JavaArchiveImpl(new MemoryMapArchiveImpl("test.jar"));
+ moduleArchive.addResource(TEST_RESOURCE);
+ moduleArchive.addResource(new BasicPath("test.txt"), TEST_RESOURCE);
+
+ archive.addModule(moduleArchive);
+
+ Path expectedPath = new BasicPath(
+ PATH_MODULE,
+ moduleArchive.getName());
+
+ Assert.assertTrue(
+ "A application module should be located in /",
+ archive.contains(expectedPath));
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImplTestCase.java (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/spec/JavaArchiveImplTestCase.java)
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImplTestCase.java (rev 0)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/JavaArchiveImplTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,160 @@
+/*
+ * 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.spec;
+
+import java.util.logging.Logger;
+
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.impl.base.spec.JavaArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.spec.donotchange.DummyClassUsedForClassResourceTest;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * JavaArchiveImplTestCase
+ *
+ * Test case to ensure that the JavaArchive follows the Jar spec.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class JavaArchiveImplTestCase
+{
+ private static final Logger log = Logger.getLogger(JavaArchiveImplTestCase.class.getName());
+
+ private static final String TEST_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
+
+ private static final Path PATH_MANIFEST = new BasicPath("META-INF");
+
+ private static final Path PATH_RESOURCE = new BasicPath("/");
+
+ private static final Path PATH_CLASS = new BasicPath("/");
+
+ private JavaArchive archive;
+
+ @Before
+ public void createArchive()
+ {
+ archive = new JavaArchiveImpl(new MemoryMapArchiveImpl());
+ }
+
+ @After
+ public void ls()
+ {
+ System.out.println("test at jboss:/$ ls -l " + archive.getName());
+ System.out.println(archive.toString(true));
+ }
+
+ @Test
+ public void shouldBeAbleToSetManifestFile() throws Exception
+ {
+ archive.setManifest(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_MANIFEST, "MANIFEST.MF");
+
+ Assert.assertTrue(
+ "The MANIFEST.MF file should be located under /META-INF/MANIFEST.MF",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddManifestResource() throws Exception
+ {
+ archive.addManifestResource(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_MANIFEST, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A manifest resource should be located under /META-INF/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddManifestResourceWithNewName() throws Exception
+ {
+ String newName = "test.txt";
+ archive.addManifestResource(new BasicPath(newName), TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_MANIFEST, newName);
+
+ Assert.assertTrue(
+ "A manifest resoruce should be located under /META-INF/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddResource() throws Exception
+ {
+ archive.addResource(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_RESOURCE, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A resoruce should be located under /",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddResourceWithNewName() throws Exception
+ {
+ String newName = "test.txt";
+ archive.addResource(TEST_RESOURCE, newName);
+
+ Path expectedPath = new BasicPath(
+ PATH_RESOURCE,
+ "/org/jboss/shrinkwrap/impl/base/asset/" + newName);
+
+ Assert.assertTrue(
+ "A resoruce should be located under /",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddClass() throws Exception
+ {
+ archive.addClasses(DummyClassUsedForClassResourceTest.class);
+
+ Path expectedPath = new BasicPath(
+ PATH_CLASS,
+ AssetUtil.getFullPathForClassResource(DummyClassUsedForClassResourceTest.class));
+
+ Assert.assertTrue(
+ "A class should be located under /",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddPackage() throws Exception
+ {
+ archive.addPackages(false, DummyClassUsedForClassResourceTest.class.getPackage());
+
+ Path expectedPath = new BasicPath(
+ PATH_CLASS,
+ AssetUtil.getFullPathForClassResource(DummyClassUsedForClassResourceTest.class));
+
+ Assert.assertTrue(
+ "A class should be located under /",
+ archive.contains(expectedPath));
+ }
+
+}
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImplTestCase.java (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/spec/WebArchiveImplTestCase.java)
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImplTestCase.java (rev 0)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/WebArchiveImplTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -0,0 +1,156 @@
+/*
+ * 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.spec;
+
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.asset.AssetUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.impl.base.spec.WebArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.spec.donotchange.DummyClassUsedForClassResourceTest;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * WebArchiveImplTestCase
+ *
+ * Test case to ensure that the WebArchive follows the War spec.
+ *
+ * @author <a href="mailto:aslak at conduct.no">Aslak Knutsen</a>
+ * @version $Revision: $
+ */
+public class WebArchiveImplTestCase
+{
+ private static final String TEST_RESOURCE = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
+
+ private static final Path PATH_WEBINF = new BasicPath("WEB-INF");
+
+ private static final Path PATH_LIBRARY = new BasicPath(PATH_WEBINF, "lib");
+
+ private static final Path PATH_CLASSES = new BasicPath(PATH_WEBINF, "classes");
+
+ private static final Path PATH_RESOURCE = new BasicPath();
+
+ private WebArchive archive;
+
+ @Before
+ public void createWebArchive() throws Exception
+ {
+ archive = new WebArchiveImpl(new MemoryMapArchiveImpl());
+ }
+
+ @After
+ public void ls()
+ {
+ System.out.println("test at jboss:/$ ls -l " + archive.getName());
+ System.out.println(archive.toString(true));
+ }
+
+ @Test
+ public void shouldBeAbleToSetWebXML() throws Exception
+ {
+ archive.setWebXML(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_WEBINF, "web.xml");
+
+ Assert.assertTrue(
+ "web.xml should be located in /WEB-INF/web.xml",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddWebResource() throws Exception {
+
+ archive.addWebResource(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_WEBINF, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A resource should be located in /WEB-INF/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddWebResourceWithNewName() throws Exception {
+
+ String newName = "test.txt";
+ archive.addWebResource(new BasicPath(newName), TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_WEBINF, newName);
+
+ Assert.assertTrue(
+ "A resource should be located in /WEB-INF/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddLibrary() throws Exception
+ {
+ archive.addLibrary(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_LIBRARY, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A library should be located in /WEB-INF/lib/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddClasses() throws Exception
+ {
+ archive.addClasses(DummyClassUsedForClassResourceTest.class);
+
+ Path expectedPath = new BasicPath(
+ PATH_CLASSES,
+ AssetUtil.getFullPathForClassResource(
+ DummyClassUsedForClassResourceTest.class));
+
+ Assert.assertTrue(
+ "A class should be located in /WEB-INF/classes/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddPackages() throws Exception
+ {
+ archive.addPackages(true, DummyClassUsedForClassResourceTest.class.getPackage());
+
+ Path expectedPath = new BasicPath(
+ PATH_CLASSES,
+ AssetUtil.getFullPathForClassResource(
+ DummyClassUsedForClassResourceTest.class));
+
+ Assert.assertTrue(
+ "A class should be located in /WEB-INF/classes/",
+ archive.contains(expectedPath));
+ }
+
+ @Test
+ public void shouldBeAbleToAddResource() throws Exception
+ {
+ archive.addResource(TEST_RESOURCE);
+
+ Path expectedPath = new BasicPath(PATH_RESOURCE, TEST_RESOURCE);
+
+ Assert.assertTrue(
+ "A resource should be located in /",
+ archive.contains(expectedPath));
+ }
+}
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/donotchange (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/spec/donotchange)
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/donotchange/DummyClassUsedForClassResourceTest.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/spec/donotchange/DummyClassUsedForClassResourceTest.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/spec/donotchange/DummyClassUsedForClassResourceTest.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.spec.donotchange;
+package org.jboss.shrinkwrap.impl.base.spec.donotchange;
/**
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/test)
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/test/ArchiveTestBase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/test/ArchiveTestBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,22 +14,22 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.test;
+package org.jboss.shrinkwrap.impl.base.test;
import java.util.Arrays;
import java.util.Map;
import junit.framework.Assert;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.impl.base.MemoryMapArchiveImpl;
-import org.jboss.declarchive.impl.base.Validate;
-import org.jboss.declarchive.impl.base.asset.ArchiveAsset;
-import org.jboss.declarchive.impl.base.asset.ClassLoaderAsset;
-import org.jboss.declarchive.impl.base.io.IOUtil;
-import org.jboss.declarchive.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.Validate;
+import org.jboss.shrinkwrap.impl.base.asset.ArchiveAsset;
+import org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
import org.junit.After;
import org.junit.Test;
@@ -44,7 +44,25 @@
*/
public abstract class ArchiveTestBase<T extends Archive<T>>
{
+ //-------------------------------------------------------------------------------------||
+ // Class Members ----------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
/**
+ * Name of a properties file upon the test CP
+ */
+ private static final String NAME_TEST_PROPERTIES = "org/jboss/shrinkwrap/impl/base/asset/Test.properties";
+
+ /**
+ * Name of another properties file upon the test CP
+ */
+ private static final String NAME_TEST_PROPERTIES_2 = "org/jboss/shrinkwrap/impl/base/asset/Test2.properties";
+
+ //-------------------------------------------------------------------------------------||
+ // Instance Members -------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
+ /**
* Get the {@link Archive} to test.
*
* @return A Archive<T> instance.
@@ -60,6 +78,10 @@
*/
protected abstract Archive<T> createNewArchive();
+ //-------------------------------------------------------------------------------------||
+ // Tests ------------------------------------------------------------------------------||
+ //-------------------------------------------------------------------------------------||
+
/**
* Simple printout of the tested archive.
*/
@@ -79,7 +101,7 @@
public void testAddAssetToPath() throws Exception
{
Archive<T> archive = getArchive();
- Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path location = new BasicPath("/", "test.properties");
archive.add(location, asset);
@@ -95,7 +117,7 @@
public void testAddRequiresPath() throws Exception
{
Archive<T> archive = getArchive();
- Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
try
{
@@ -134,7 +156,7 @@
{
Archive<T> archive = getArchive();
final String name = "test.properties";
- final Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ final Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
Path location = new BasicPath("/");
archive.add(location, name, asset);
@@ -153,7 +175,7 @@
{
Archive<T> archive = getArchive();
final String name = "test.properties";
- final Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ final Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
try
{
archive.add(null, name, asset);
@@ -173,7 +195,7 @@
{
Archive<T> archive = getArchive();
final Path path = new BasicPath("/", "Test.properties");
- final String resource = "org/jboss/declarchive/impl/base/asset/Test.properties";
+ final String resource = NAME_TEST_PROPERTIES;
try
{
archive.add(path, null, new ClassLoaderAsset(resource));
@@ -212,12 +234,12 @@
public void testDeleteAsset() throws Exception
{
Archive<T> archive = getArchive();
- String resource = "org/jboss/declarchive/impl/base/asset/Test.properties";
+ String resource = NAME_TEST_PROPERTIES;
Path location = new BasicPath("/", "test.properties");
archive.add(location, new ClassLoaderAsset(resource));
Assert.assertTrue(archive.contains(location)); // Sanity check
- Assert.assertTrue("Successfully deleting an Asset should ruturn true", archive.delete(location));
+ Assert.assertTrue("Successfully deleting an Asset should return true", archive.delete(location));
Assert.assertFalse("There should no longer be an asset at: " + location.get() + " after deleted", archive
.contains(location));
@@ -233,7 +255,7 @@
Archive<T> archive = getArchive();
Path location = new BasicPath("/", "test.properties");
- Assert.assertFalse("Deleting a non-existent Asset should ruturn false", archive.delete(location));
+ Assert.assertFalse("Deleting a non-existent Asset should return false", archive.delete(location));
}
/**
@@ -263,7 +285,7 @@
{
Archive<T> archive = getArchive();
Path location = new BasicPath("/", "test.properties");
- Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
+ Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
archive.add(location, asset);
Asset fetchedAsset = archive.get(location);
@@ -300,8 +322,8 @@
Path location = new BasicPath("/", "test.properties");
Path locationTwo = new BasicPath("/", "test2.properties");
- Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
archive.add(location, asset).add(locationTwo, assetTwo);
Map<Path, Asset> content = archive.getContent();
@@ -382,8 +404,8 @@
Path location = new BasicPath("/", "test.properties");
Path locationTwo = new BasicPath("/", "test2.properties");
- Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
sourceArchive.add(location, asset).add(locationTwo, assetTwo);
archive.merge(sourceArchive);
@@ -406,8 +428,8 @@
Path location = new BasicPath("/", "test.properties");
Path locationTwo = new BasicPath("/", "test2.properties");
- Asset asset = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test.properties");
- Asset assetTwo = new ClassLoaderAsset("org/jboss/declarchive/impl/base/asset/Test2.properties");
+ Asset asset = new ClassLoaderAsset(NAME_TEST_PROPERTIES);
+ Asset assetTwo = new ClassLoaderAsset(NAME_TEST_PROPERTIES_2);
sourceArchive.add(location, asset).add(locationTwo, assetTwo);
Path baseLocation = new BasicPath("somewhere");
Copied: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit (from rev 3512, declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/unit)
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/unit/EnterpriseArchiveFactoryTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/EnterpriseArchiveFactoryTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.unit;
+package org.jboss.shrinkwrap.impl.base.unit;
import junit.framework.Assert;
-import org.jboss.declarchive.api.EnterpriseArchiveFactory;
-import org.jboss.declarchive.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.EnterpriseArchiveFactory;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.junit.Test;
/**
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/unit/JavaArchiveFactoryTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/JavaArchiveFactoryTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.unit;
+package org.jboss.shrinkwrap.impl.base.unit;
import junit.framework.Assert;
-import org.jboss.declarchive.api.JavaArchiveFactory;
-import org.jboss.declarchive.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.JavaArchiveFactory;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Test;
/**
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/MemoryMapArchiveTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/unit/MemoryMapArchiveTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/MemoryMapArchiveTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.unit;
+package org.jboss.shrinkwrap.impl.base.unit;
import junit.framework.Assert;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.impl.base.MemoryMapArchiveImpl;
-import org.jboss.declarchive.impl.base.test.ArchiveTestBase;
-import org.jboss.declarchive.spi.MemoryMapArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.impl.base.MemoryMapArchiveImpl;
+import org.jboss.shrinkwrap.impl.base.test.ArchiveTestBase;
+import org.jboss.shrinkwrap.spi.MemoryMapArchive;
import org.junit.Before;
import org.junit.Test;
Modified: declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java
===================================================================
--- declarchive/trunk/impl-base/src/test/java/org/jboss/declarchive/impl/base/unit/WebArchiveFactoryTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/java/org/jboss/shrinkwrap/impl/base/unit/WebArchiveFactoryTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,12 +14,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.base.unit;
+package org.jboss.shrinkwrap.impl.base.unit;
import junit.framework.Assert;
-import org.jboss.declarchive.api.WebArchiveFactory;
-import org.jboss.declarchive.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.WebArchiveFactory;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
/**
Copied: declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset (from rev 3512, declarchive/trunk/impl-base/src/test/resources/org/jboss/declarchive/impl/base/asset)
Modified: declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/Test.properties
===================================================================
--- declarchive/trunk/impl-base/src/test/resources/org/jboss/declarchive/impl/base/asset/Test.properties 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/Test.properties 2009-09-12 22:35:41 UTC (rev 3513)
@@ -1 +1 @@
-declarch=true
\ No newline at end of file
+shrinkwrap=true
\ No newline at end of file
Modified: declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/Test2.properties
===================================================================
--- declarchive/trunk/impl-base/src/test/resources/org/jboss/declarchive/impl/base/asset/Test2.properties 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-base/src/test/resources/org/jboss/shrinkwrap/impl/base/asset/Test2.properties 2009-09-12 22:35:41 UTC (rev 3513)
@@ -1 +1 @@
-declarch=true
\ No newline at end of file
+shrinkwrap=true
\ No newline at end of file
Modified: declarchive/trunk/impl-jdkfile/pom.xml
===================================================================
--- declarchive/trunk/impl-jdkfile/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-jdkfile/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,18 +17,18 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-impl-jdkfile</artifactId>
+ <artifactId>shrinkwrap-impl-jdkfile</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive JDK File-based Implementations</name>
- <description>JDK File-based Implementations of the Declarchive Project</description>
+ <name>ShrinkWrap JDK File-based Implementations</name>
+ <description>JDK File-based Implementations of the ShrinkWrap Project</description>
<!-- Properties -->
<properties>
<!-- Versioning -->
- <version.org.jboss.declarchive_declarchive.impl.base>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.impl.base>
- <version.org.jboss.declarchive_declarchive.spi.jdkfile>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.spi.jdkfile>
+ <version.org.jboss.shrinkwrap_shrinkwrap.impl.base>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.impl.base>
+ <version.org.jboss.shrinkwrap_shrinkwrap.spi.jdkfile>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.spi.jdkfile>
</properties>
@@ -36,17 +36,17 @@
<dependencies>
<!--
- org.jboss.declarchive
+ org.jboss.shrinkwrap
-->
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-impl-base</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.impl.base}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.impl.base}</version>
</dependency>
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-spi-jdkfile</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.spi.jdkfile}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-spi-jdkfile</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.spi.jdkfile}</version>
</dependency>
<!--
Copied: declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile (from rev 3512, declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/declarchive/impl/jdkfile)
Modified: declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/SecurityActions.java
===================================================================
--- declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/declarchive/impl/jdkfile/SecurityActions.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/SecurityActions.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.jdkfile;
+package org.jboss.shrinkwrap.impl.jdkfile;
import java.security.AccessController;
import java.security.PrivilegedAction;
Modified: declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/TempFileArchiveImpl.java
===================================================================
--- declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/declarchive/impl/jdkfile/TempFileArchiveImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-jdkfile/src/main/java/org/jboss/shrinkwrap/impl/jdkfile/TempFileArchiveImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.jdkfile;
+package org.jboss.shrinkwrap.impl.jdkfile;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -24,7 +24,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* TempFileArchiveImpl
Modified: declarchive/trunk/impl-vfs/pom.xml
===================================================================
--- declarchive/trunk/impl-vfs/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-vfs/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,18 +17,18 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-impl-vfs</artifactId>
+ <artifactId>shrinkwrap-impl-vfs</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive VFS Implementations</name>
- <description>VFS Implementations of the Declarchive Project</description>
+ <name>ShrinkWrap VFS Implementations</name>
+ <description>VFS Implementations of the ShrinkWrap Project</description>
<!-- Properties -->
<properties>
<!-- Versioning -->
- <version.org.jboss.declarchive_declarchive.impl.base>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.impl.base>
- <version.org.jboss.declarchive_declarchive.spi.vfs>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.spi.vfs>
+ <version.org.jboss.shrinkwrap_shrinkwrap.impl.base>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.impl.base>
+ <version.org.jboss.shrinkwrap_shrinkwrap.spi.vfs>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.spi.vfs>
</properties>
@@ -36,24 +36,24 @@
<dependencies>
<!--
- org.jboss.declarchive
+ org.jboss.shrinkwrap
-->
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-impl-base</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.impl.base}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.impl.base}</version>
</dependency>
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-impl-base</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.impl.base}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-impl-base</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.impl.base}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-spi-vfs</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.spi.vfs}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-spi-vfs</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.spi.vfs}</version>
</dependency>
<!--
Copied: declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs (from rev 3512, declarchive/trunk/impl-vfs/src/main/java/org/jboss/declarchive/impl/vfs)
Modified: declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/VfsArchiveBase.java
===================================================================
--- declarchive/trunk/impl-vfs/src/main/java/org/jboss/declarchive/impl/vfs/VfsArchiveBase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/VfsArchiveBase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.vfs;
+package org.jboss.shrinkwrap.impl.vfs;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -22,9 +22,9 @@
import java.util.List;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.impl.base.ArchiveBase;
-import org.jboss.declarchive.spi.vfs.VfsArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.impl.base.ArchiveBase;
+import org.jboss.shrinkwrap.spi.vfs.VfsArchive;
import org.jboss.virtual.VirtualFile;
/**
@@ -86,7 +86,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#toString(boolean)
+ * @see org.jboss.shrinkwrap.api.Archive#toString(boolean)
*/
@Override
public String toString(final boolean verbose)
Modified: declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveImpl.java
===================================================================
--- declarchive/trunk/impl-vfs/src/main/java/org/jboss/declarchive/impl/vfs/VfsMemoryArchiveImpl.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-vfs/src/main/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveImpl.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.vfs;
+package org.jboss.shrinkwrap.impl.vfs;
import java.io.IOException;
import java.io.InputStream;
@@ -27,14 +27,14 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Asset;
-import org.jboss.declarchive.api.AssetNotFoundException;
-import org.jboss.declarchive.api.Path;
-import org.jboss.declarchive.impl.base.Validate;
-import org.jboss.declarchive.impl.base.asset.ByteArrayAsset;
-import org.jboss.declarchive.impl.base.io.IOUtil;
-import org.jboss.declarchive.impl.base.path.BasicPath;
-import org.jboss.declarchive.spi.vfs.VfsArchive;
+import org.jboss.shrinkwrap.api.Asset;
+import org.jboss.shrinkwrap.api.AssetNotFoundException;
+import org.jboss.shrinkwrap.api.Path;
+import org.jboss.shrinkwrap.impl.base.Validate;
+import org.jboss.shrinkwrap.impl.base.asset.ByteArrayAsset;
+import org.jboss.shrinkwrap.impl.base.io.IOUtil;
+import org.jboss.shrinkwrap.impl.base.path.BasicPath;
+import org.jboss.shrinkwrap.spi.vfs.VfsArchive;
import org.jboss.virtual.MemoryFileFactory;
import org.jboss.virtual.VFS;
import org.jboss.virtual.VirtualFile;
@@ -124,7 +124,7 @@
//-------------------------------------------------------------------------------------||
/**
- * @see org.jboss.declarchive.impl.base.ArchiveBase#getActualClass()
+ * @see org.jboss.shrinkwrap.impl.base.ArchiveBase#getActualClass()
*/
@Override
protected Class<VfsArchive> getActualClass()
@@ -134,7 +134,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#add(org.jboss.declarchive.api.Path, org.jboss.declarchive.api.Asset)
+ * @see org.jboss.shrinkwrap.api.Archive#add(org.jboss.shrinkwrap.api.Path, org.jboss.shrinkwrap.api.Asset)
*/
@Override
public VfsArchive add(final Path target, final Asset asset) throws IllegalArgumentException
@@ -163,7 +163,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#contains(org.jboss.declarchive.api.Path)
+ * @see org.jboss.shrinkwrap.api.Archive#contains(org.jboss.shrinkwrap.api.Path)
*/
//TODO Add support into VFS for this
@Override
@@ -187,7 +187,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#delete(org.jboss.declarchive.api.Path)
+ * @see org.jboss.shrinkwrap.api.Archive#delete(org.jboss.shrinkwrap.api.Path)
*/
@Override
public boolean delete(final Path path) throws IllegalArgumentException
@@ -219,7 +219,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#get(org.jboss.declarchive.api.Path)
+ * @see org.jboss.shrinkwrap.api.Archive#get(org.jboss.shrinkwrap.api.Path)
*/
@Override
public Asset get(final Path path) throws AssetNotFoundException, IllegalArgumentException
@@ -242,7 +242,7 @@
/**
* {@inheritDoc}
- * @see org.jboss.declarchive.api.Archive#getContent()
+ * @see org.jboss.shrinkwrap.api.Archive#getContent()
*/
@Override
public Map<Path, Asset> getContent()
Copied: declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs (from rev 3512, declarchive/trunk/impl-vfs/src/test/java/org/jboss/declarchive/impl/vfs)
Modified: declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveFactoryTestCase.java
===================================================================
--- declarchive/trunk/impl-vfs/src/test/java/org/jboss/declarchive/impl/vfs/VfsMemoryArchiveFactoryTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveFactoryTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,14 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.impl.vfs;
+package org.jboss.shrinkwrap.impl.vfs;
import java.util.logging.Logger;
import junit.framework.Assert;
-import org.jboss.declarchive.api.mightmoveordelete.VfsMemoryArchiveFactory;
-import org.jboss.declarchive.spi.vfs.VfsArchive;
+import org.jboss.shrinkwrap.api.mightmoveordelete.VfsMemoryArchiveFactory;
+import org.jboss.shrinkwrap.spi.vfs.VfsArchive;
import org.jboss.virtual.VFS;
import org.junit.BeforeClass;
import org.junit.Test;
Modified: declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveTestCase.java
===================================================================
--- declarchive/trunk/impl-vfs/src/test/java/org/jboss/declarchive/impl/vfs/VfsMemoryArchiveTestCase.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/impl-vfs/src/test/java/org/jboss/shrinkwrap/impl/vfs/VfsMemoryArchiveTestCase.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -19,14 +19,15 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.declarchive.impl.vfs;
+package org.jboss.shrinkwrap.impl.vfs;
import java.util.UUID;
import java.util.logging.Logger;
-import org.jboss.declarchive.api.Archive;
-import org.jboss.declarchive.impl.base.test.ArchiveTestBase;
-import org.jboss.declarchive.spi.vfs.VfsArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.impl.base.test.ArchiveTestBase;
+import org.jboss.shrinkwrap.impl.vfs.VfsMemoryArchiveImpl;
+import org.jboss.shrinkwrap.spi.vfs.VfsArchive;
import org.jboss.virtual.VFS;
import org.junit.Before;
import org.junit.BeforeClass;
Modified: declarchive/trunk/pom.xml
===================================================================
--- declarchive/trunk/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -16,13 +16,13 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Information -->
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-parent</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>Declarchive Aggregator</name>
+ <name>ShrinkWrap Aggregator</name>
<url>http://www.jboss.org</url>
- <description>Declarchive Aggregator</description>
+ <description>ShrinkWrap Aggregator</description>
<!-- Aggregate Modules -->
<modules>
Modified: declarchive/trunk/spi/pom.xml
===================================================================
--- declarchive/trunk/spi/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/spi/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,17 +17,17 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-spi</artifactId>
+ <artifactId>shrinkwrap-spi</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive SPI</name>
- <description>Generic Service Provider Contract of the Declarchive Project</description>
+ <name>ShrinkWrap SPI</name>
+ <description>Generic Service Provider Contract of the ShrinkWrap Project</description>
<!-- Properties -->
<properties>
<!-- Versioning -->
- <version.org.jboss.declarchive_declarchive.api>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.api>
+ <version.org.jboss.shrinkwrap_shrinkwrap.api>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.api>
</properties>
@@ -35,9 +35,9 @@
<dependencies>
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-api</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.api}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-api</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.api}</version>
</dependency>
</dependencies>
Copied: declarchive/trunk/spi/src/main/java/org/jboss/shrinkwrap/spi (from rev 3512, declarchive/trunk/spi/src/main/java/org/jboss/declarchive/spi)
Modified: declarchive/trunk/spi/src/main/java/org/jboss/shrinkwrap/spi/MemoryMapArchive.java
===================================================================
--- declarchive/trunk/spi/src/main/java/org/jboss/declarchive/spi/MemoryMapArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/spi/src/main/java/org/jboss/shrinkwrap/spi/MemoryMapArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.spi;
+package org.jboss.shrinkwrap.spi;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* MemoryMapArchive
Modified: declarchive/trunk/spi-jdkfile/pom.xml
===================================================================
--- declarchive/trunk/spi-jdkfile/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/spi-jdkfile/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,17 +17,17 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-spi-jdkfile</artifactId>
+ <artifactId>shrinkwrap-spi-jdkfile</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive SPI for JDK File I/O</name>
- <description>Service Provider Contract for JDK File I/O Implementations of the Declarchive Project</description>
+ <name>ShrinkWrap SPI for JDK File I/O</name>
+ <description>Service Provider Contract for JDK File I/O Implementations of the ShrinkWrap Project</description>
<!-- Properties -->
<properties>
<!-- Versioning -->
- <version.org.jboss.declarchive_declarchive.api>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.api>
+ <version.org.jboss.shrinkwrap_shrinkwrap.api>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.api>
</properties>
@@ -35,12 +35,12 @@
<dependencies>
<!--
- org.jboss.declarchive
+ org.jboss.shrinkwrap
-->
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-api</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.api}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-api</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.api}</version>
</dependency>
<!--
Copied: declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/jdk/file (from rev 3512, declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/declarchive/spi/jdk/file)
Modified: declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/jdk/file/FileArchive.java
===================================================================
--- declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/declarchive/spi/jdk/file/FileArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/spi-jdkfile/src/main/java/org/jboss/shrinkwrap/spi/jdk/file/FileArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,11 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.spi.jdk.file;
+package org.jboss.shrinkwrap.spi.jdk.file;
import java.io.File;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
/**
* FileArchive
Modified: declarchive/trunk/spi-vfs/pom.xml
===================================================================
--- declarchive/trunk/spi-vfs/pom.xml 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/spi-vfs/pom.xml 2009-09-12 22:35:41 UTC (rev 3513)
@@ -7,8 +7,8 @@
<!-- Parent -->
<parent>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-build</artifactId>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-build</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
@@ -17,17 +17,17 @@
<modelVersion>4.0.0</modelVersion>
<!-- Artifact Configuration -->
- <artifactId>declarchive-spi-vfs</artifactId>
+ <artifactId>shrinkwrap-spi-vfs</artifactId>
<version>0.1.0-SNAPSHOT</version>
- <name>Declarchive SPI for VFS</name>
- <description>Service Provider Contract for VFS Implementations of the Declarchive Project</description>
+ <name>ShrinkWrap SPI for VFS</name>
+ <description>Service Provider Contract for VFS Implementations of the ShrinkWrap Project</description>
<!-- Properties -->
<properties>
<!-- Versioning -->
- <version.org.jboss.declarchive_declarchive.api>0.1.0-SNAPSHOT</version.org.jboss.declarchive_declarchive.api>
+ <version.org.jboss.shrinkwrap_shrinkwrap.api>0.1.0-SNAPSHOT</version.org.jboss.shrinkwrap_shrinkwrap.api>
<version.org.jboss_jboss.vfs>2.2.0.M4</version.org.jboss_jboss.vfs>
</properties>
@@ -36,12 +36,12 @@
<dependencies>
<!--
- org.jboss.declarchive
+ org.jboss.shrinkwrap
-->
<dependency>
- <groupId>org.jboss.declarchive</groupId>
- <artifactId>declarchive-api</artifactId>
- <version>${version.org.jboss.declarchive_declarchive.api}</version>
+ <groupId>org.jboss.shrinkwrap</groupId>
+ <artifactId>shrinkwrap-api</artifactId>
+ <version>${version.org.jboss.shrinkwrap_shrinkwrap.api}</version>
</dependency>
<!--
Copied: declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/spi/vfs (from rev 3512, declarchive/trunk/spi-vfs/src/main/java/org/jboss/declarchive/spi/vfs)
Modified: declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/spi/vfs/VfsArchive.java
===================================================================
--- declarchive/trunk/spi-vfs/src/main/java/org/jboss/declarchive/spi/vfs/VfsArchive.java 2009-09-09 18:34:21 UTC (rev 3512)
+++ declarchive/trunk/spi-vfs/src/main/java/org/jboss/shrinkwrap/spi/vfs/VfsArchive.java 2009-09-12 22:35:41 UTC (rev 3513)
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.jboss.declarchive.spi.vfs;
+package org.jboss.shrinkwrap.spi.vfs;
-import org.jboss.declarchive.api.Archive;
+import org.jboss.shrinkwrap.api.Archive;
import org.jboss.virtual.VirtualFile;
/**
More information about the jboss-svn-commits
mailing list