Back to project page dw2020.
The source code is released under:
Apache License
If you think the Android project dw2020 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 net.darkwire.example.service.client; /*from w w w . j a v a2s . c o m*/ import net.darkwire.example.model.FiveHundredPxConfiguration; import com.fivehundredpx.api.auth.AccessToken; import se.akerfeldt.signpost.retrofit.RetrofitHttpOAuthConsumer; import se.akerfeldt.signpost.retrofit.SigningOkClient; /** * Created by fsiu on 3/21/14. */ public enum FiveHundredPxClient { INSTANCE; private RetrofitHttpOAuthConsumer oAuthConsumer; private AccessToken accessToken; public void setConsumer(final RetrofitHttpOAuthConsumer oAuthConsumer) { this.oAuthConsumer = oAuthConsumer; } public void setConsumer(final AccessToken accessToken) { this.accessToken = accessToken; final FiveHundredPxConfiguration fiveHundredPxConfiguration = FiveHundredPxConfiguration.INSTANCE; final RetrofitHttpOAuthConsumer oAuthConsumer = new RetrofitHttpOAuthConsumer( fiveHundredPxConfiguration.getConsumerKey(), fiveHundredPxConfiguration.getConsumerSecret()); oAuthConsumer.setTokenWithSecret(accessToken.getToken(), accessToken.getTokenSecret()); this.oAuthConsumer = oAuthConsumer; } public AccessToken getAccessToken() { return this.accessToken; } public SigningOkClient getClient() { return new SigningOkClient(this.oAuthConsumer); } }