Interface CommonArchive<T extends CommonArchive<T>>

    • Method Detail

      • contains

        boolean contains​(String path)
                  throws IllegalArgumentException
        Denotes whether this archive contains a resource at the specified path
        Parameters:
        path - the path of the resource
        Returns:
        true if the archive contains the resource, false otherwise
        Throws:
        IllegalArgumentException - If the path is not specified
      • contains

        boolean contains​(Class<?> aClass)
                  throws IllegalArgumentException
        Denotes whether this archive contains a class
        Parameters:
        aClass - a class
        Returns:
        true if the archive contains the class, false otherwise.
        Throws:
        IllegalArgumentException - If the path is not specified
      • deleteClasses

        T deleteClasses​(Class<?>... classes)
        Deletes the Classes in the Archive.
        Parameters:
        classes - the classes to delete in the archive.
        Returns:
        this archive.
        Throws:
        IllegalArgumentException - If no classes were specified
      • addPackages

        T addPackages​(boolean recursive,
                      String... packages)
               throws IllegalArgumentException
        Adds all classes in the specified Packages to the Archive.
        Parameters:
        recursive - Should the sub packages be added
        packages - All the packages to add represented by a String ("my/package")
        Returns:
        This virtual archive
        Throws:
        IllegalArgumentException - If no packages were specified
        See Also:
        ClassContainer.addPackages(boolean, Filter, Package...)
      • addAsResource

        T addAsResource​(String resourceName)
                 throws IllegalArgumentException
        Adds the resource as a resource to the container, returning the container itself.
        The resource will be placed into the Container Resource path under the same context from which it was retrieved.

        The ClassLoader used to obtain the resource is up to the implementation.
        Parameters:
        resourceName - resource to add
        Returns:
        This virtual archive
        Throws:
        IllegalArgumentException - If the resourceName is null
        See Also:
        ResourceContainer.addAsResource(Asset, ArchivePath)
      • addAsResource

        T addAsResource​(String resourceName,
                        String target)
                 throws IllegalArgumentException
        Adds the resource as a resource to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Parameters:
        resourceName - resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives resource path.
        Returns:
        This virtual archive
        Throws:
        IllegalArgumentException - if resourceName is null or if target is null
        See Also:
        ResourceContainer.addAsResource(Asset, ArchivePath)
      • applyManually

        T applyManually​(CommonArchive.OnShrinkWrapWar onShrinkWrapWar)
        Applies a configuration by using directly the WebArchive instance provided by the ShrinkWrap API.
        Parameters:
        onShrinkWrapWar - the instance of an anonymous implementation of CommonArchive.OnShrinkWrapWar interface.
        Returns:
        the instance of the war builder.