org.jboss.shrinkwrap.api.container
Interface LibraryContainer<T extends Archive<T>>

All Known Subinterfaces:
EnterpriseArchive, ResourceAdapterArchive, WebArchive

public interface LibraryContainer<T extends Archive<T>>

Defines the contract for a component capable of storing Libraries.

The actual path to the Library resources within the Archive is up to the implementations/specifications.

Version:
$Revision: $
Author:
Aslak Knutsen

Method Summary
 T addAsLibraries(Archive<?>... archives)
          Add multiple Archives to this Archive as libraries to the container, returning the container itself.
 T addAsLibraries(Collection<? extends Archive<?>> archives)
          Add multiple Archives to this Archive as libraries to the container, returning the container itself.
 T addAsLibraries(File... resources)
          Add multiple File to this Archive as libraries to the container, returning the container itself.
 T addAsLibraries(String... resourceNames)
          Add multiple resources to this Archive as libraries to the container, returning the container itself.
 T addAsLibrary(Archive<?> archive)
          Add another Archive to this Archive as a library to the container, returning the container itself.
 T addAsLibrary(Asset resource, ArchivePath target)
          Adds the Asset as a library to the container, returning the container itself.
 T addAsLibrary(Asset resource, String target)
          Adds the Asset as a library to the container, returning the container itself.
 T addAsLibrary(File resource)
          Adds the File as a library to the container, returning the container itself.
 T addAsLibrary(File resource, ArchivePath target)
          Adds the File as a library to the container, returning the container itself.
 T addAsLibrary(File resource, String target)
          Adds the File as a library to the container, returning the container itself.
 T addAsLibrary(String resourceName)
          Adds the resource as a library to the container, returning the container itself.
 T addAsLibrary(String resourceName, ArchivePath target)
          Adds the resource as a library to the container, returning the container itself.
 T addAsLibrary(String resourceName, String target)
          Adds the resource as a library to the container, returning the container itself.
 T addAsLibrary(URL resource, ArchivePath target)
          Adds the URL as a library to the container, returning the container itself.
 T addAsLibrary(URL resource, String target)
          Adds the URL as a library to the container, returning the container itself.
 

Method Detail

addAsLibrary

T addAsLibrary(String resourceName)
                                  throws IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.
The resource will be placed into the Container Library 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 resourceName is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(File resource)
                                  throws IllegalArgumentException
Adds the File as a library to the container, returning the container itself.
The File will be placed into the Container Library path under File.getName().

Parameters:
resource - File resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(String resourceName,
               String target)
                                  throws IllegalArgumentException
Adds the resource as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(File resource,
               String target)
                                  throws IllegalArgumentException
Adds the File as a library to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(URL resource,
               String target)
                                  throws IllegalArgumentException
Adds the URL as a library to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(Asset resource,
               String target)
                                  throws IllegalArgumentException
Adds the Asset as a library to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(String resourceName,
               ArchivePath target)
                                  throws IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resource - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(File resource,
               ArchivePath target)
                                  throws IllegalArgumentException
Adds the File as a library to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(URL resource,
               ArchivePath target)
                                  throws IllegalArgumentException
Adds the URL as a library to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibrary

T addAsLibrary(Asset resource,
               ArchivePath target)
                                  throws IllegalArgumentException
Adds the Asset as a library to the container, returning the container itself.

Parameters:
target - The target path within the archive in which to add the resource, relative to the Archives library path.
resource - Asset resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null

addAsLibrary

T addAsLibrary(Archive<?> archive)
                                  throws IllegalArgumentException
Add another Archive to this Archive as a library to the container, returning the container itself.
The Archive will be placed into the Container Library path under Archive.getName().

Parameters:
archive - Archive resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if Archive is null
See Also:
addAsLibrary(Asset, ArchivePath)

addAsLibraries

T addAsLibraries(String... resourceNames)
                                    throws IllegalArgumentException
Add multiple resources to this Archive as libraries to the container, returning the container itself.
The resources will be placed into the Container Library path under the same context from which they were retrieved.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceNames - resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceNames are null or empty
See Also:
addAsLibrary(String)

addAsLibraries

T addAsLibraries(File... resources)
                                    throws IllegalArgumentException
Add multiple File to this Archive as libraries to the container, returning the container itself.
The Files will be placed into the Container Library path under File.getName().

Parameters:
resourceNames - File resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if File resources are null or empty
See Also:
addAsLibrary(File)

addAsLibraries

T addAsLibraries(Archive<?>... archives)
                                    throws IllegalArgumentException
Add multiple Archives to this Archive as libraries to the container, returning the container itself.
The Archives will be placed into the Container Library path under Archive.getName().

Parameters:
archive - Archive resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if Archive resources are null
See Also:
addAsLibrary(Archive)

addAsLibraries

T addAsLibraries(Collection<? extends Archive<?>> archives)
                                    throws IllegalArgumentException
Add multiple Archives to this Archive as libraries to the container, returning the container itself.
The Archives will be placed into the Container Library path under Archive.getName().

Parameters:
archive - Archive resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if Collection of archives is null
See Also:
addAsLibrary(Archive)


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.