]> average.org Git - WhereAmI.git/commitdiff
rename token access methods
authorEugene Crosser <Eugene.Crosser@ru.ibm.com>
Fri, 3 Feb 2012 10:18:13 +0000 (14:18 +0400)
committerEugene Crosser <Eugene.Crosser@ru.ibm.com>
Fri, 3 Feb 2012 10:18:13 +0000 (14:18 +0400)
src/org/average/whereami/Authorize.java
src/org/average/whereami/Oracle.java
src/org/average/whereami/PersistentStore.java

index 1137ea57e454e3518509c40edaa21553aca8156c..804486f63de2e8d27f10a9e118ec93fbbe894529 100644 (file)
@@ -68,12 +68,11 @@ public class Authorize extends Activity {
                                 ClientCredentials.CLIENT_SECRET,
                                 code,
                                 ClientCredentials.REDIRECT_URI).execute();
-                            PersistentStore credentialStore =
-                                                    new PersistentStore(prefs);
-                            credentialStore.write(accessTokenResponse);
+                            PersistentStore store = new PersistentStore(prefs);
+                            store.writeTokens(accessTokenResponse);
                             finish();
                         } else if (url.indexOf("error=")!=-1) {
-                            new PersistentStore(prefs).clear();
+                            new PersistentStore(prefs).clearTokens();
                             finish();
                         }
                     } catch (IOException e) {
index 28effd937f81521374ccc0e3302e97f5104fd781..ed3f93f5017af32841b45c53ae66c7d2679ae5eb 100644 (file)
@@ -30,7 +30,7 @@ public class Oracle {
 
                httpTransport = AndroidHttp.newCompatibleTransport();
                jsonFactory = new JacksonFactory();
-               AccessTokenResponse token = store.read();
+               AccessTokenResponse token = store.readTokens();
                Log.v(TAG, "tokens - access: \"" + token.accessToken +
                        "\", refresh: \"" + token.refreshToken +
                        "\", client_id: \"" + ClientCredentials.CLIENT_ID +
index 595fbf75b3170e2d2a2d49c97fb027eb8e32a659..c39f822a0f2ab6929f6e45ca349ef5f6a2239803 100644 (file)
@@ -19,7 +19,7 @@ public class PersistentStore {
         this.prefs = prefs;
     }
 
-    public AccessTokenResponse read() {
+    public AccessTokenResponse readTokens() {
         AccessTokenResponse accessTokenResponse = new AccessTokenResponse();
         accessTokenResponse.accessToken = prefs.getString(ACCESS_TOKEN, "");
         accessTokenResponse.expiresIn = prefs.getLong(EXPIRES_IN, 0);
@@ -28,7 +28,7 @@ public class PersistentStore {
         return accessTokenResponse;
     }
 
-    public void write(AccessTokenResponse accessTokenResponse) {
+    public void writeTokens(AccessTokenResponse accessTokenResponse) {
         Editor editor = prefs.edit();
         editor.putString(ACCESS_TOKEN,accessTokenResponse.accessToken);
         editor.putLong(EXPIRES_IN,accessTokenResponse.expiresIn);
@@ -37,7 +37,7 @@ public class PersistentStore {
         editor.commit();
     }
 
-    public void clear() {
+    public void clearTokens() {
         Editor editor = prefs.edit();
         editor.remove(ACCESS_TOKEN);
         editor.remove(EXPIRES_IN);