Changeset 13173 in josm for trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
- Timestamp:
- 2017-11-28T00:56:29+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
r12928 r13173 5 5 6 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.data.Preferences;8 7 import org.openstreetmap.josm.io.OsmApi; 9 8 import org.openstreetmap.josm.spi.preferences.Config; … … 96 95 97 96 /** 98 * Replies a set of parameters as defined in the preferences.99 *100 * @param pref the preferences101 * @return the parameters102 * @deprecated (since 12928) replaced by {@link #createFromApiUrl(java.lang.String)}103 */104 @Deprecated105 public static OAuthParameters createFromPreferences(Preferences pref) {106 OAuthParameters parameters = createDefault(pref.get("osm-server.url"));107 return new OAuthParameters(108 pref.get("oauth.settings.consumer-key", parameters.getConsumerKey()),109 pref.get("oauth.settings.consumer-secret", parameters.getConsumerSecret()),110 pref.get("oauth.settings.request-token-url", parameters.getRequestTokenUrl()),111 pref.get("oauth.settings.access-token-url", parameters.getAccessTokenUrl()),112 pref.get("oauth.settings.authorise-url", parameters.getAuthoriseUrl()),113 pref.get("oauth.settings.osm-login-url", parameters.getOsmLoginUrl()),114 pref.get("oauth.settings.osm-logout-url", parameters.getOsmLogoutUrl()));115 }116 117 /**118 97 * Remembers the current values in the preferences. 119 98 */ … … 126 105 Config.getPref().put("oauth.settings.osm-login-url", getOsmLoginUrl()); 127 106 Config.getPref().put("oauth.settings.osm-logout-url", getOsmLogoutUrl()); 128 }129 130 /**131 * Remembers the current values in the preferences <code>pref</code>.132 *133 * @param pref the preferences. Must not be null.134 * @throws IllegalArgumentException if pref is null.135 * @deprecated (since 12928) replaced by {@link #rememberPreferences()}136 */137 @Deprecated138 public void rememberPreferences(Preferences pref) {139 CheckParameterUtil.ensureParameterNotNull(pref, "pref");140 pref.put("oauth.settings.consumer-key", getConsumerKey());141 pref.put("oauth.settings.consumer-secret", getConsumerSecret());142 pref.put("oauth.settings.request-token-url", getRequestTokenUrl());143 pref.put("oauth.settings.access-token-url", getAccessTokenUrl());144 pref.put("oauth.settings.authorise-url", getAuthoriseUrl());145 pref.put("oauth.settings.osm-login-url", getOsmLoginUrl());146 pref.put("oauth.settings.osm-logout-url", getOsmLogoutUrl());147 107 } 148 108
Note:
See TracChangeset
for help on using the changeset viewer.