// Does the resource already exist? If so this is an update (PUT) not a create (POST)
boolean alreadyExists = resourceExists(suggestedPath);
AbderaClient abderaClient = new AbderaClient(abdera);
final Factory factory = abdera.getFactory();
boolean isCollection = resource instanceof Collection;
ExtensibleElement element;
if (isCollection) {
Feed feed = factory.newFeed();
feed.setId(baseURI + APPConstants.ATOM + encodeURL(suggestedPath));
// feed.setId(encodeURL(suggestedPath));
feed.setTitle(suggestedPath);
feed.setSubtitle(resource.getDescription());
feed.addAuthor(username);
feed.setUpdated(new Date());
element = feed;
} else {
Entry entry = factory.newEntry();
entry.setId(baseURI + APPConstants.ATOM + encodeURL(suggestedPath));
// entry.setId(encodeURL(suggestedPath));
entry.setTitle(suggestedPath);
entry.setSummary(resource.getDescription());
entry.addAuthor(username);