public static void updateFile(ContainerConfig config,String containerConfigURL,String schemaPrefixFileName) throws IOException {
  ReplaceInFileUtils containerFile=new ReplaceInFileUtils(containerConfigURL);
  containerFile.xmlReplace(CONTAINER_NAME_PROP,schemaPrefixFileName);
  containerFile.xmlReplace(LOOKUP_ENABLED_PROP,String.valueOf(config.isJiniLusEnabled()));
  containerFile.xmlReplace(LOOKUP_JNDI_ENABLED_PROP,String.valueOf(config.isJndiEnabled()));
  if (config.jndiUrl != null)   containerFile.xmlReplace(LOOKUP_JNDI_URL_PROP,config.jndiUrl);
  if (config.lookupGroups != null)   containerFile.xmlReplace(LOOKUP_GROUP_PROP,config.lookupGroups);
  containerFile.xmlReplace(LOOKUP_UNICAST_ENABLED_PROP,String.valueOf(config.unicastEnabled));
  if (config.unicastURL != null)   containerFile.xmlReplace(LOOKUP_UNICAST_URL_PROP,config.unicastURL);
  containerFile.xmlReplace(LOOKUP_JMS_ENABLED_PROP,String.valueOf(config.jmsEnabled));
  containerFile.xmlReplace(LOOKUP_JMS_INTERNAL_ENABLED_PROP,String.valueOf(config.jmsInternalJndiEnabled));
  containerFile.xmlReplace(LOOKUP_JMS_EXT_ENABLED_PROP,String.valueOf(config.jmsExtJndiEnabled));
  containerFile.close();
}

public static void updateFile ( ContainerConfig config , String containerConfigURL , String schemaPrefixFileName ) throws IOException { ReplaceInFileUtils containerFile = new ReplaceInFileUtils ( containerConfigURL ) ; containerFile . xmlReplace ( CONTAINER_NAME_PROP , schemaPrefixFileName ) ; containerFile . xmlReplace ( LOOKUP_ENABLED_PROP , String . valueOf ( config . isJiniLusEnabled ( ) ) ) ; containerFile . xmlReplace ( LOOKUP_JNDI_ENABLED_PROP , String . valueOf ( config . isJndiEnabled ( ) ) ) ; if ( config . jndiUrl != null ) containerFile . xmlReplace ( LOOKUP_JNDI_URL_PROP , config . jndiUrl ) ; if ( config . lookupGroups != null ) containerFile . xmlReplace ( LOOKUP_GROUP_PROP , config . lookupGroups ) ; containerFile . xmlReplace ( LOOKUP_UNICAST_ENABLED_PROP , String . valueOf ( config . unicastEnabled ) ) ; if ( config . unicastURL != null ) containerFile . xmlReplace ( LOOKUP_UNICAST_URL_PROP , config . unicastURL ) ; containerFile . xmlReplace ( LOOKUP_JMS_ENABLED_PROP , String . valueOf ( config . jmsEnabled ) ) ; containerFile . xmlReplace ( LOOKUP_JMS_INTERNAL_ENABLED_PROP , String . valueOf ( config . jmsInternalJndiEnabled ) ) ; containerFile . xmlReplace ( LOOKUP_JMS_EXT_ENABLED_PROP , String . valueOf ( config . jmsExtJndiEnabled ) ) ; containerFile . close ( ) ; }
pass through container configuration / schema xml file and change its values according to properties saved in containerconfig instance .
