|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.cics.bundle.Bundle
public class Bundle
Usage:
This class is used to generate Bundle archives.
Class level design/service information:
This class provides the functionality for the user to create new bundle
archives together with associated manifest file (including support for
IMPORT, EXPORT and DEFINEs.
Bundle
Field Summary | |
---|---|
static int |
MANIFEST_DEFINE
Constant to represent MANIFEST_DEFINE element. |
static int |
MANIFEST_EXPORT
Constant to represent MANIFEST_EXPORT element. |
static int |
MANIFEST_IMPORT
Constant to represent MANIFEST_IMPORT element. |
Constructor Summary | |
---|---|
Bundle(java.util.jar.JarOutputStream jarOutputStream)
Usage: Contructor to create new Bundle and initialize default Manifest file values. |
Method Summary | |
---|---|
void |
addArchiveFile(java.lang.String path,
java.io.InputStream inputStream)
Usage: Function to read in a stream and write it to the bundle archive file. |
void |
addDefine(Manifest.Define defElement,
java.io.InputStream inputStream)
|
void |
addDefine(java.lang.String name,
java.lang.String type,
java.lang.String path,
java.io.InputStream inputStream)
Usage: To add a DEFINE element and stream to the bundle and manifest. (1)The manifest entry is written first and then (2)the stream is added to the bundle archive. |
void |
addDefine(java.lang.String name,
java.lang.String type,
java.lang.String path,
java.io.InputStream inputStream,
boolean optional,
boolean warn)
Usage: To add a DEFINE element and stream to the bundle and manifest. (1)The manifest entry is written first and then (2)the stream is added to the bundle archive. |
void |
addExport(Manifest.Export expElement)
|
void |
addExport(java.lang.String name,
java.lang.String type)
Usage: To add an EXPORT element to the bundle and manifest. Any existing EXPORT with the same name and type is overwritten. |
void |
addImport(Manifest.Import impElement)
|
void |
addImport(java.lang.String name,
java.lang.String type)
Usage: To add an IMPORT element to the bundle and manifest. Any existing IMPORT with the same name and type is overwritten. |
void |
addImport(java.lang.String name,
java.lang.String type,
boolean optional,
boolean warn)
Usage: To add an IMPORT element to the bundle and manifest. Any existing IMPORT with the same name and type is overwritten. |
void |
deleteDefine(java.lang.String name,
java.lang.String type)
Usage: To delete a DEFINE element from the Manifest instance. Note: Any files/streams written to the bundle archive will persist. Existing DEFINE element with the supplied name and type is deleted from the Manifest. |
void |
deleteExport(java.lang.String name,
java.lang.String type)
Usage: To delete an EXPORT element from the bundle instance. Existing EXPORT with the supplied name and type is deleted. |
void |
deleteImport(java.lang.String name,
java.lang.String type)
Usage: To delete an IMPORT element from the bundle instance. Existing IMPORT with the supplied name and type is deleted. |
boolean |
manifestEntryExist(int elementType,
java.lang.String name,
java.lang.String type)
Usage: To check if the Manifest instance contains an existence of the named element |
void |
writeArchive()
Usage: This function should be called after all entries ( DEFINE s,
IMPORT s and EXPORT s) have been added to
the Bundle archive.The Manifest XML file is created and added to the Bundle archive. |
void |
writeManifest(java.io.OutputStream manifestOutStream)
Usage: This function should be called after all entries ( DEFINE s,
IMPORT s and EXPORT s) have been added to
the Manifest.Only returns the Manifest file |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MANIFEST_IMPORT
public static final int MANIFEST_EXPORT
public static final int MANIFEST_DEFINE
Constructor Detail |
---|
public Bundle(java.util.jar.JarOutputStream jarOutputStream)
jarOutputStream
- the output stream for the final Bundle archive file.Method Detail |
---|
public void addImport(java.lang.String name, java.lang.String type, boolean optional, boolean warn)
name
- the name of the element.type
- the type of the element.optional
- indicator set true for optional element.warn
- indicator for when optional is true. Value is ignored
when optional is false.public void addImport(java.lang.String name, java.lang.String type)
name
- the name of the element.type
- the type of the element.public void addImport(Manifest.Import impElement)
public void deleteImport(java.lang.String name, java.lang.String type)
name
- the name of the element.type
- the type of the element.public void addExport(java.lang.String name, java.lang.String type)
name
- the name of the element.type
- the type of the element.public void addExport(Manifest.Export expElement)
public void deleteExport(java.lang.String name, java.lang.String type)
name
- the name of the element.type
- the type of the element.public void addDefine(java.lang.String name, java.lang.String type, java.lang.String path, java.io.InputStream inputStream, boolean optional, boolean warn) throws java.io.IOException
(1)Any existing Manifest DEFINE element with the same name and type is
overwritten. If no element exists then there is no change.
(2)The supplied stream is added to the Bundle archive. If the file
already exists in the archive an exception is thrown but the Manifest
entry is already written.
name
- the name of the element.type
- the type of the element.path
- the relative path of the stream to be added to the Bundle
archive (Including filename).inputStream
- the stream to be added to the archive file.optional
- indicator set true for optional element.warn
- indicator for when optional is true. Value is ignored
when optional is false.
java.io.IOException
public void addDefine(Manifest.Define defElement, java.io.InputStream inputStream) throws java.io.IOException
java.io.IOException
public void addDefine(java.lang.String name, java.lang.String type, java.lang.String path, java.io.InputStream inputStream) throws java.io.IOException
(1)Any existing Manifest DEFINE element with the same name and type is
overwritten. If no element exists then there is no change.
(2)The supplied stream is added to the Bundle archive. If the file
already exists in the archive an exception is thrown but the Manifest
entry is already written.
name
- the name of the element.type
- the type of the element.path
- the relative path of the stream to be added to the Bundle
archive (Including filename).inputStream
- the stream to be added to the archive file.
java.io.IOException
public void deleteDefine(java.lang.String name, java.lang.String type)
name
- the name of the element.type
- the type of the element.public boolean manifestEntryExist(int elementType, java.lang.String name, java.lang.String type)
elementType
- the element type to search. See
MANIFEST_IMPORT, MANIFEST_EXPORT, MANIFEST_DEFINE
.name
- the name of the element.type
- the type of the element.
public void addArchiveFile(java.lang.String path, java.io.InputStream inputStream) throws java.io.IOException
path
- the location and file name of the data in the bundle archive.inputStream
- the data to be written to the bundle archive.
java.io.IOException
public void writeArchive() throws javax.xml.bind.JAXBException, java.io.IOException
DEFINE
s,
IMPORT
s and EXPORT
s) have been added to
the Bundle archive.
javax.xml.bind.JAXBException
java.io.IOException
public void writeManifest(java.io.OutputStream manifestOutStream) throws javax.xml.bind.JAXBException, java.io.IOException
DEFINE
s,
IMPORT
s and EXPORT
s) have been added to
the Manifest.
javax.xml.bind.JAXBException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |