private AiravataRegistry2 registry;
public JCRComponentRegistry(String username, String password) throws RegistryException {
String gatewayName=null;
AiravataRegistryConnectionDataProvider provider = AiravataRegistryFactory.getRegistryConnectionDataProvider();
if (provider==null){
URL configURL = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
if(configURL != null){
try {
Properties properties = new Properties();
properties.load(configURL.openStream());
if (username==null){
if(properties.get(RegistryConstants.KEY_DEFAULT_REGISTRY_USER) != null){
username = (String)properties.get(RegistryConstants.KEY_DEFAULT_REGISTRY_USER);
}
}
gatewayName = (String)properties.get(RegistryConstants.KEY_DEFAULT_GATEWAY_ID);
} catch (MalformedURLException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
}else{
try {
if (username==null){
username=provider.getValue(RegistryConstants.KEY_DEFAULT_REGISTRY_USER).toString();
}
gatewayName = provider.getValue(RegistryConstants.KEY_DEFAULT_GATEWAY_ID).toString();
} catch (Exception e) {
log.warn(e.getMessage());
}
}
if (username==null){