if (propertiesFile != null)
System.getProperties().load(new FileInputStream(propertiesFile));
String configFile = PathUtils.doDynamicReplacement(System.getProperty("org.apache..oodt.cas.catalog.client.config.file", "classpath:/org/apache/oodt/cas/catalog/config/catserv-client-config.xml"));
FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(new String[] { configFile }, false);
// appContext.setClassLoader(new Serializer().getClassLoader());
appContext.refresh();
List<CmdLineOptionInstance> optionInstances = CmdLineOptionUtils.loadValidateAndHandleInstances(appContext, args);
CmdLineOptionInstance instance = CmdLineOptionUtils.getOptionInstanceByName("clientFactoryBeanId", optionInstances);
CatalogServiceClientFactory csClientFactory = (CatalogServiceClientFactory) appContext.getBean(instance.getValues().get(0), CatalogServiceClientFactory.class);
CatalogServiceClient csClient = csClientFactory.createCatalogService();
instance = CmdLineOptionUtils.getOptionInstanceByName("action", optionInstances);