Class Hierarchy All Classes All Fields and Methods

Class com.ibm.broker.config.proxy.BarFile

java.lang.Object
        com.ibm.broker.config.proxy.BarFile

public class BarFile
extends Object

Represents a broker archive file on the local filesystem.

After deployment, each deployed artefact contains a property that is the name of the BarFile in which it was successfully deployed. However, to retrieve the complete contents of that BarFile, it must exist on the local filesystem. In other words, once a BarFile is deployed it cannot be accessed directly through the Configuration Manager or broker using this class.

To instantiate BarFile objects, you must use a BarFile factory method. If you modify the BarFile in any way, you must use one of either the save() or saveAs() methods in order to make the changes persistent. For example:

     BarFile b = BarFile.loadBarFile("C:\\MyBars\\test.bar");
     DeploymentDescriptor d = new DeploymentDescriptor();
     // ...
     b.setDeploymentDescriptor(d);
     b.save();
 

com.ibm.broker.config.proxy.BarFile

Responsibilities A representation of a broker archive file on the local filesystem. Provides the ability to list the contents and manipulate the deployment descriptor
Internal Collaborators com.ibm.broker.config.proxy.DeploymentDescriptor


 Change Activity:
 -------- ----------- -------------   ------------------------------------
 Reason:  Date:       Originator:     Comments:
 -------- ----------- -------------   ------------------------------------
 45166    2007-06-05  HDMPL           v6.1 Release
 
 

Field Index
Field Description
copyright IBM Copyright
sccsid Version information
Method Index
Method Description
Enumeration getBarEntries() Returns the set of Bar entries that are contained in the BarFile.
BarEntry getBarEntryByName(String) Returns the bar entry that has the supplied name.
Enumeration getBarEntryNames() Returns the set of Bar entry filenames that are contained in the BarFile.
DeploymentDescriptor getDeploymentDescriptor() Returns the object that represents the deployment descriptor.
BarFile loadBarFile(String) Factory for the BarFile class.
void save() Saves the contents of the BarFile to a file on the local filesystem.
void saveAs(String) Saves the contents of the BarFile to a file on the local filesystem.
void setDeploymentDescriptor(DeploymentDescriptor) Sets the deployment descriptor associated with this object.

Fields

copyright

protected static final java.lang.String copyright

IBM Copyright

sccsid

protected static final java.lang.String sccsid

Version information

Methods

getBarEntries

public Enumeration getBarEntries() 

Returns the set of Bar entries that are contained in the BarFile.

getBarEntryByName

public BarEntry getBarEntryByName(String filename) 

Returns the bar entry that has the supplied name. The format of the filename is the same as was supplied by getBarEntryName(). If no BarEntry exists with the supplied name, null is returned.

getBarEntryNames

public Enumeration getBarEntryNames() 

Returns the set of Bar entry filenames that are contained in the BarFile.

getDeploymentDescriptor

public DeploymentDescriptor getDeploymentDescriptor() 

Returns the object that represents the deployment descriptor. If there is no deployment descriptor associated with this BarFile, this method returns null.

loadBarFile

public static BarFile loadBarFile(String pathAndFileName) throws IOException

Factory for the BarFile class. If the File to which the BarFile refers already exists on the local filesystem, its contents are read and stored locally.

save

public void save() throws IOException

Saves the contents of the BarFile to a file on the local filesystem. If any changes have been made to the deployment descriptor since it was instantiated, this method causes these changes to be persisted. The original Bar file is replaced with the new one.

saveAs

public void saveAs(String outputFilename) throws IOException

Saves the contents of the BarFile to a file on the local filesystem. If any changes have been made to the deployment descriptor since it was instantiated, this method causes these changes to be persisted.

setDeploymentDescriptor

public void setDeploymentDescriptor(DeploymentDescriptor newDescriptor) 

Sets the deployment descriptor associated with this object. This method causes a new Bar file to be written to the local filesystem. If the supplied DeploymentDescriptor is null, any active deployment descriptor will be removed.

If backupDescriptorName is not null, the previous deployment descriptor will be renamed inside the Bar file to the file specified. Any path name will be ignored; the backup file will be placed in the META-INF directory and will replace any file of the same name.

If backupBarName is not null, the original Bar file will be backed up to the supplied name before the operation begins.

Class Hierarchy All Classes All Fields and Methods