org.jboss.soa.esb.util
Class DeploymentArchive

java.lang.Object
  extended by org.jboss.soa.esb.util.DeploymentArchive

public class DeploymentArchive
extends java.lang.Object

Deployment archive.

Author:
tom.fennelly@jboss.com

Constructor Summary
DeploymentArchive(java.lang.String archiveName)
          Public constructor.
 
Method Summary
 void addEntry(java.lang.Class clazz)
          Add the supplied class as an entry in the deployment.
 void addEntry(java.lang.String path)
          Add an "empty" entry in the deployment.
 void addEntry(java.lang.String path, byte[] data)
          Add the supplied data as an entry in the deployment.
 void addEntry(java.lang.String path, java.io.InputStream data)
          Add the supplied data as an entry in the deployment.
 void addEntry(java.lang.String path, java.lang.String resource)
          Add the specified classpath resource as an entry in the deployment.
 java.lang.String getArchiveName()
          Get the name of the deployment associated with this archive.
 java.util.jar.JarInputStream toInputStream()
          Create a JarInputStream for the entries defined in this archive.
 void toOutputStream(java.io.OutputStream outputStream)
          Create an archive of the specified name and containing entries for the data contained in the streams supplied entries arg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeploymentArchive

public DeploymentArchive(java.lang.String archiveName)
Public constructor.

Parameters:
archiveName - The archive name of the deployment.
Method Detail

getArchiveName

public java.lang.String getArchiveName()
Get the name of the deployment associated with this archive.

Returns:
The name of the deployment.

addEntry

public void addEntry(java.lang.String path,
                     java.io.InputStream data)
Add the supplied data as an entry in the deployment.

Parameters:
path - The target path of the entry when added to the archive.
data - The data.

addEntry

public void addEntry(java.lang.String path,
                     byte[] data)
Add the supplied data as an entry in the deployment.

Parameters:
path - The target path of the entry when added to the archive.
data - The data.

addEntry

public void addEntry(java.lang.String path)
Add an "empty" entry in the deployment.

Equivalent to adding an empty folder.

Parameters:
path - The target path of the entry when added to the archive.

addEntry

public void addEntry(java.lang.String path,
                     java.lang.String resource)
              throws java.io.IOException
Add the specified classpath resource as an entry in the deployment.

Parameters:
path - The target path of the entry when added to the archive.
resource - The classpath resource.
Throws:
java.io.IOException - Failed to read resource from classpath.

addEntry

public void addEntry(java.lang.Class clazz)
              throws java.io.IOException
Add the supplied class as an entry in the deployment.

Parameters:
clazz - The class to be added.
Throws:
java.io.IOException - Failed to read class from classpath.

toOutputStream

public void toOutputStream(java.io.OutputStream outputStream)
                    throws java.io.IOException
Create an archive of the specified name and containing entries for the data contained in the streams supplied entries arg. specifying the entry name and the value is a InputStream containing the entry data.

Parameters:
outputStream - The archive output stream.
Throws:
java.io.IOException - Write failure.

toInputStream

public java.util.jar.JarInputStream toInputStream()
                                           throws java.io.IOException
Create a JarInputStream for the entries defined in this archive.

Returns:
The JarInputStream for the entries in this archive.
Throws:
java.io.IOException - Failed to create stream.