String parameter = propertyName.split("\\.")[1];
OAuthAccessor accessor = accessors.get(key);
if (accessor == null) {
OAuthServiceProvider provider = new OAuthServiceProvider("", "", "");
OAuthConsumer consumer = new OAuthConsumer("", "", "", provider);
accessor = new OAuthAccessor(consumer);
accessors.put(key, accessor);
}
if (parameter.equalsIgnoreCase(ACCESS_URL)) {
OAuthServiceProvider provider = new OAuthServiceProvider(
accessor.consumer.serviceProvider.requestTokenURL,
accessor.consumer.serviceProvider.userAuthorizationURL,
properties.getProperty(propertyName, "").trim());
OAuthConsumer consumer = new OAuthConsumer("",
accessor.consumer.consumerKey,
accessor.consumer.consumerSecret,
provider);
OAuthAccessor newAccessor = new OAuthAccessor(consumer);
copyProperties(newAccessor, accessor);
accessors.put(key, newAccessor);
} else if (parameter.equalsIgnoreCase(AUTH_URL)) {
OAuthServiceProvider provider = new OAuthServiceProvider(
accessor.consumer.serviceProvider.requestTokenURL,
properties.getProperty(propertyName, "").trim(),
accessor.consumer.serviceProvider.accessTokenURL);
OAuthConsumer consumer = new OAuthConsumer("",
accessor.consumer.consumerKey,
accessor.consumer.consumerSecret,
provider);
OAuthAccessor newAccessor = new OAuthAccessor(consumer);
copyProperties(newAccessor, accessor);
accessors.put(key, newAccessor);
} else if (parameter.equalsIgnoreCase(REQUEST_URL)) {
OAuthServiceProvider provider = new OAuthServiceProvider(
properties.getProperty(propertyName, "").trim(),
accessor.consumer.serviceProvider.userAuthorizationURL,
accessor.consumer.serviceProvider.accessTokenURL);
OAuthConsumer consumer = new OAuthConsumer("",
accessor.consumer.consumerKey,
accessor.consumer.consumerSecret,
provider);
OAuthAccessor newAccessor = new OAuthAccessor(consumer);
copyProperties(newAccessor, accessor);
accessors.put(key, newAccessor);
} else if (parameter.equalsIgnoreCase(CONSUMER_KEY)) {
OAuthConsumer consumer = new OAuthConsumer("",
properties.getProperty(propertyName, "").trim(),
accessor.consumer.consumerSecret,
accessor.consumer.serviceProvider);
OAuthAccessor newAccessor = new OAuthAccessor(consumer);
copyProperties(newAccessor, accessor);
accessors.put(key, newAccessor);
} else if (parameter.equalsIgnoreCase(CONSUMER_SECRET)) {
OAuthConsumer consumer = new OAuthConsumer("",
accessor.consumer.consumerKey,
properties.getProperty(propertyName, "").trim(),
accessor.consumer.serviceProvider);
OAuthAccessor newAccessor = new OAuthAccessor(consumer);
copyProperties(newAccessor, accessor);