final boolean deleted = this.deletedResources.remove(path);
final MongoDBResource oldResource = (MongoDBResource)this.getResource(resolver, path, info);
if ( !deleted && oldResource != null ) {
throw new PersistenceException("Resource already exists at " + path, null, path, null);
}
final DBObject dbObj = new BasicDBObject();
dbObj.put(getPROP_PATH(), info[1]);
if ( properties != null ) {
for(Map.Entry<String, Object> entry : properties.entrySet()) {
final String key = propNameToKey(entry.getKey());
dbObj.put(key, entry.getValue());
}
}
if ( deleted && oldResource != null ) {
dbObj.put(PROP_ID, oldResource.getProperties().get(PROP_ID));
}
final MongoDBResource rsrc = new MongoDBResource(resolver, path, info[0], dbObj, this);
this.changedResources.put(path, rsrc);
return rsrc;