Back to project page ReadabilitySDK.
The source code is released under:
MIT License
If you think the Android project ReadabilitySDK listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.idemidov.readability.command; /*from ww w . ja v a2 s. c om*/ import com.idemidov.readability.command.params_builders.ParamsBuilder; import com.idemidov.readability.data.Bookmark; import com.idemidov.readability.parser.GetBookmarkByIdParser; import com.idemidov.readability.parser.Parser; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpUriRequest; import org.json.JSONException; import java.io.UnsupportedEncodingException; import oauth.signpost.OAuthConsumer; import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer; import oauth.signpost.exception.OAuthCommunicationException; import oauth.signpost.exception.OAuthExpectationFailedException; import oauth.signpost.exception.OAuthMessageSignerException; public class UpdateBookmarkByIdCommand extends BaseCommand<Bookmark> { private int id; private ParamsBuilder paramsBuilder; public UpdateBookmarkByIdCommand(OAuthConsumer consumer, int id, ParamsBuilder paramsBuilder) { super(consumer); this.id = id; this.paramsBuilder = paramsBuilder; } @Override Parser<Bookmark> getParser() { return new GetBookmarkByIdParser(); } @Override String getUrl() { return ROOT_URL.concat("bookmarks/").concat(String.valueOf(id)); } @Override HttpUriRequest getHttpUriRequest() throws UnsupportedEncodingException { HttpPost post = new HttpPost(getUrl()); post.setHeader(CONTENT_TYPE_NAME, CONTENT_TYPE_VALUE); post.setEntity(new UrlEncodedFormEntity(paramsBuilder.build())); return post; } }