}
@Override
protected Method methodFor(SaveActivityAction action, Resource resource)
{
Method method;
if (action.getActivity().isTransient())
{
method = new Method(resource, POST.name());
}
else
{
method = new Method(resource, PUT.name());
}
method = method.header(HEADER_CONTENT_TYPE, CONTENT_TYPE_JSON).text(activityWriter.toJson(action.getActivity()));
return method;
}