Changeset 2861 in josm for trunk/src


Ignore:
Timestamp:
2010-01-15T10:44:16+01:00 (14 years ago)
Author:
Gubaer
Message:

fixed #4375: authorise -> authorize

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
5 edited
9 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/oauth/AbstractAuthorizationUI.java

    r2858 r2861  
    1313 *
    1414 */
    15 public abstract class AbstractAuthorisationUI extends VerticallyScrollablePanel{
     15public abstract class AbstractAuthorizationUI extends VerticallyScrollablePanel{
    1616    /**
    1717     * The property name for the Access Token property
    1818     */
    19     static public final String ACCESS_TOKEN_PROP = AbstractAuthorisationUI.class.getName() + ".accessToken";
     19    static public final String ACCESS_TOKEN_PROP = AbstractAuthorizationUI.class.getName() + ".accessToken";
    2020
    2121    private String apiUrl;
     
    2727    }
    2828
    29     public AbstractAuthorisationUI() {
     29    public AbstractAuthorizationUI() {
    3030        pnlAdvancedProperties = new AdvancedOAuthPropertiesPanel();
    3131    }
  • trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedure.java

    r2858 r2861  
    22package org.openstreetmap.josm.gui.oauth;
    33
    4 public enum AuthorisationProcedure {
     4public enum AuthorizationProcedure {
    55    /**
    66     * Run a fully automatic procedure to get an access token from the OSM website.
  • trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java

    r2858 r2861  
    1313import javax.swing.UIManager;
    1414
    15 public class AuthorisationProcedureComboBox extends JComboBox {
     15public class AuthorizationProcedureComboBox extends JComboBox {
    1616
    17     public AuthorisationProcedureComboBox() {
     17    public AuthorizationProcedureComboBox() {
    1818        setModel(new AuthorisationProcedureComboBoxModel());
    1919        setRenderer(new AuthorisationProcedureCellRenderer());
    20         setSelectedItem(AuthorisationProcedure.FULLY_AUTOMATIC);
     20        setSelectedItem(AuthorizationProcedure.FULLY_AUTOMATIC);
    2121    }
    2222
     
    2525        public Object getElementAt(int index) {
    2626            switch(index) {
    27             case 0: return AuthorisationProcedure.FULLY_AUTOMATIC;
    28             case 1: return AuthorisationProcedure.SEMI_AUTOMATIC;
    29             case 2: return AuthorisationProcedure.MANUALLY;
     27            case 0: return AuthorizationProcedure.FULLY_AUTOMATIC;
     28            case 1: return AuthorizationProcedure.SEMI_AUTOMATIC;
     29            case 2: return AuthorizationProcedure.MANUALLY;
    3030            }
    3131            return null;
     
    5353        }
    5454
    55         protected void renderText(AuthorisationProcedure value) {
     55        protected void renderText(AuthorizationProcedure value) {
    5656            switch(value) {
    5757            case FULLY_AUTOMATIC:
     
    6767        }
    6868
    69         protected void renderToolTipText(AuthorisationProcedure value) {
     69        protected void renderToolTipText(AuthorizationProcedure value) {
    7070            switch(value) {
    7171            case FULLY_AUTOMATIC:
     
    9494
    9595        public Component getListCellRendererComponent(JList list, Object value, int idx, boolean isSelected, boolean hasFocus) {
    96             AuthorisationProcedure procedure = (AuthorisationProcedure)value;
     96            AuthorizationProcedure procedure = (AuthorizationProcedure)value;
    9797            renderColors(isSelected);
    9898            renderText(procedure);
  • trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java

    r2858 r2861  
    5454 *
    5555 */
    56 public class FullyAutomaticAuthorisationUI extends AbstractAuthorisationUI {
     56public class FullyAutomaticAuthorizationUI extends AbstractAuthorizationUI {
    5757
    5858    private JTextField tfUserName;
     
    311311    }
    312312
    313     public FullyAutomaticAuthorisationUI() {
     313    public FullyAutomaticAuthorizationUI() {
    314314        build();
    315315    }
     
    338338
    339339        public void actionPerformed(ActionEvent evt) {
    340             Main.worker.submit(new FullyAutomaticAuthorisationTask(FullyAutomaticAuthorisationUI.this));
     340            Main.worker.submit(new FullyAutomaticAuthorisationTask(FullyAutomaticAuthorizationUI.this));
    341341        }
    342342
     
    385385        public void actionPerformed(ActionEvent arg0) {
    386386            Main.worker.submit(new TestAccessTokenTask(
    387                     FullyAutomaticAuthorisationUI.this,
     387                    FullyAutomaticAuthorizationUI.this,
    388388                    getApiUrl(),
    389389                    getAdvancedPropertiesPanel().getAdvancedParameters(),
     
    437437    class FullyAutomaticAuthorisationTask extends PleaseWaitRunnable {
    438438        private boolean canceled;
    439         private OsmOAuthAuthorisationClient authClient;
     439        private OsmOAuthAuthorizationClient authClient;
    440440
    441441        public FullyAutomaticAuthorisationTask(Component parent) {
     
    451451        protected void finish() {}
    452452
    453         protected void alertAuthorisationFailed(OsmOAuthAuthorisationException e) {
     453        protected void alertAuthorisationFailed(OsmOAuthAuthorizationException e) {
    454454            HelpAwareOptionPane.showOptionDialog(
    455                     FullyAutomaticAuthorisationUI.this,
     455                    FullyAutomaticAuthorizationUI.this,
    456456                    tr("<html>"
    457457                            + "The automatic process for retrieving an OAuth Access Token<br>"
     
    469469        protected void alertInvalidLoginUrl() {
    470470            HelpAwareOptionPane.showOptionDialog(
    471                     FullyAutomaticAuthorisationUI.this,
     471                    FullyAutomaticAuthorizationUI.this,
    472472                    tr("<html>"
    473473                            + "The automatic process for retrieving an OAuth Access Token<br>"
     
    488488            try {
    489489                loginUrl = authClient.buildOsmLoginUrl();
    490             } catch(OsmOAuthAuthorisationException e1) {
     490            } catch(OsmOAuthAuthorizationException e1) {
    491491                alertInvalidLoginUrl();
    492492                return;
    493493            }
    494494            HelpAwareOptionPane.showOptionDialog(
    495                     FullyAutomaticAuthorisationUI.this,
     495                    FullyAutomaticAuthorizationUI.this,
    496496                    tr("<html>"
    497497                            + "The automatic process for retrieving an OAuth Access Token<br>"
     
    509509        }
    510510
    511         protected void handleException(final OsmOAuthAuthorisationException e) {
     511        protected void handleException(final OsmOAuthAuthorizationException e) {
    512512            Runnable r = new Runnable() {
    513513                public void run() {
     
    531531            try {
    532532                getProgressMonitor().setTicksCount(3);
    533                 authClient = new OsmOAuthAuthorisationClient(
     533                authClient = new OsmOAuthAuthorizationClient(
    534534                        getAdvancedPropertiesPanel().getAdvancedParameters()
    535535                );
     
    564564                    SwingUtilities.invokeLater(r);
    565565                }
    566             } catch(final OsmOAuthAuthorisationException e) {
     566            } catch(final OsmOAuthAuthorizationException e) {
    567567                handleException(e);
    568568            }
  • trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java

    r2858 r2861  
    3333import org.openstreetmap.josm.tools.ImageProvider;
    3434
    35 public class ManualAuthorisationUI extends AbstractAuthorisationUI{
     35public class ManualAuthorizationUI extends AbstractAuthorizationUI{
    3636
    3737    private JTextField tfAccessTokenKey;
     
    152152    }
    153153
    154     public ManualAuthorisationUI() {
     154    public ManualAuthorizationUI() {
    155155        build();
    156156    }
     
    237237        public void actionPerformed(ActionEvent evt) {
    238238            TestAccessTokenTask task = new TestAccessTokenTask(
    239                     ManualAuthorisationUI.this,
     239                    ManualAuthorizationUI.this,
    240240                    getApiUrl(),
    241241                    getAdvancedPropertiesPanel().getAdvancedParameters(),
     
    250250
    251251        public void propertyChange(PropertyChangeEvent evt) {
    252             if (! evt.getPropertyName().equals(AbstractAuthorisationUI.ACCESS_TOKEN_PROP))
     252            if (! evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP))
    253253                return;
    254254            updateEnabledState();
  • trunk/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java

    r2858 r2861  
    5151 *
    5252 */
    53 public class OAuthAuthorisationWizard extends JDialog {
    54     static private final Logger logger = Logger.getLogger(OAuthAuthorisationWizard.class.getName());
     53public class OAuthAuthorizationWizard extends JDialog {
     54    static private final Logger logger = Logger.getLogger(OAuthAuthorizationWizard.class.getName());
    5555
    5656    private HtmlPanel pnlMessage;
     
    5858    private String apiUrl;
    5959
    60     private AuthorisationProcedureComboBox cbAuthorisationProcedure;
    61     private FullyAutomaticAuthorisationUI pnlFullyAutomaticAuthorisationUI;
    62     private SemiAutomaticAuthorisationUI pnlSemiAutomaticAuthorisationUI;
    63     private ManualAuthorisationUI pnlManualAuthorisationUI;
     60    private AuthorizationProcedureComboBox cbAuthorisationProcedure;
     61    private FullyAutomaticAuthorizationUI pnlFullyAutomaticAuthorisationUI;
     62    private SemiAutomaticAuthorizationUI pnlSemiAutomaticAuthorisationUI;
     63    private ManualAuthorizationUI pnlManualAuthorisationUI;
    6464    private JScrollPane spAuthorisationProcedureUI;
    6565
     
    126126        gc.gridwidth = 1;
    127127        gc.weightx = 1.0;
    128         pnl.add(cbAuthorisationProcedure = new AuthorisationProcedureComboBox(),gc);
     128        pnl.add(cbAuthorisationProcedure = new AuthorizationProcedureComboBox(),gc);
    129129        cbAuthorisationProcedure.addItemListener(new AuthorisationProcedureChangeListener());
    130130        return pnl;
     
    136136     */
    137137    protected void refreshAuthorisationProcedurePanel() {
    138         AuthorisationProcedure procedure = (AuthorisationProcedure)cbAuthorisationProcedure.getSelectedItem();
     138        AuthorizationProcedure procedure = (AuthorizationProcedure)cbAuthorisationProcedure.getSelectedItem();
    139139        switch(procedure) {
    140140        case FULLY_AUTOMATIC:
     
    162162        getContentPane().add(buildHeaderInfoPanel(), BorderLayout.NORTH);
    163163
    164         pnlFullyAutomaticAuthorisationUI = new FullyAutomaticAuthorisationUI();
     164        pnlFullyAutomaticAuthorisationUI = new FullyAutomaticAuthorizationUI();
    165165        pnlFullyAutomaticAuthorisationUI.setApiUrl(apiUrl);
    166166
    167         pnlSemiAutomaticAuthorisationUI = new SemiAutomaticAuthorisationUI();
     167        pnlSemiAutomaticAuthorisationUI = new SemiAutomaticAuthorizationUI();
    168168        pnlSemiAutomaticAuthorisationUI.setApiUrl(apiUrl);
    169169
    170         pnlManualAuthorisationUI = new ManualAuthorisationUI();
     170        pnlManualAuthorisationUI = new ManualAuthorizationUI();
    171171        pnlManualAuthorisationUI.setApiUrl(apiUrl);
    172172
     
    206206     * @throws IllegalArgumentException thrown if apiUrl is null
    207207     */
    208     public OAuthAuthorisationWizard(String apiUrl) throws IllegalArgumentException {
     208    public OAuthAuthorizationWizard(String apiUrl) throws IllegalArgumentException {
    209209        super(JOptionPane.getFrameForComponent(Main.parent),true /* modal */);
    210210        CheckParameterUtil.ensureParameterNotNull(apiUrl, "apiUrl");
     
    220220     * @throws IllegalArgumentException thrown if apiUrl is null
    221221     */
    222     public OAuthAuthorisationWizard(Component parent, String apiUrl) {
     222    public OAuthAuthorizationWizard(Component parent, String apiUrl) {
    223223        super(JOptionPane.getFrameForComponent(parent),true /* modal */);
    224224        CheckParameterUtil.ensureParameterNotNull(apiUrl, "apiUrl");
     
    259259    }
    260260
    261     protected AbstractAuthorisationUI getCurrentAuthorisationUI() {
    262         switch((AuthorisationProcedure)cbAuthorisationProcedure.getSelectedItem()) {
     261    protected AbstractAuthorizationUI getCurrentAuthorisationUI() {
     262        switch((AuthorizationProcedure)cbAuthorisationProcedure.getSelectedItem()) {
    263263        case FULLY_AUTOMATIC: return pnlFullyAutomaticAuthorisationUI;
    264264        case MANUALLY: return pnlManualAuthorisationUI;
     
    371371
    372372        public void propertyChange(PropertyChangeEvent evt) {
    373             if (!evt.getPropertyName().equals(AbstractAuthorisationUI.ACCESS_TOKEN_PROP))
     373            if (!evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP))
    374374                return;
    375375            token = (OAuthToken)evt.getNewValue();
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmLoginFailedException.java

    r2801 r2861  
    22package org.openstreetmap.josm.gui.oauth;
    33
    4 public class OsmLoginFailedException extends OsmOAuthAuthorisationException{
     4public class OsmLoginFailedException extends OsmOAuthAuthorizationException{
    55
    66    public OsmLoginFailedException() {
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java

    r2858 r2861  
    3535import org.openstreetmap.josm.tools.CheckParameterUtil;
    3636
    37 public class OsmOAuthAuthorisationClient {
    38     static private final Logger logger = Logger.getLogger(OsmOAuthAuthorisationClient.class.getName());
     37public class OsmOAuthAuthorizationClient {
     38    static private final Logger logger = Logger.getLogger(OsmOAuthAuthorizationClient.class.getName());
    3939
    4040    private OAuthParameters oauthProviderParameters;
     
    4848     *
    4949     */
    50     public OsmOAuthAuthorisationClient() {
     50    public OsmOAuthAuthorizationClient() {
    5151        oauthProviderParameters = OAuthParameters.createDefault();
    5252        consumer = oauthProviderParameters.buildConsumer();
     
    6060     * @throws IllegalArgumentException thrown if parameters is null
    6161     */
    62     public OsmOAuthAuthorisationClient(OAuthParameters parameters) throws IllegalArgumentException {
     62    public OsmOAuthAuthorizationClient(OAuthParameters parameters) throws IllegalArgumentException {
    6363        CheckParameterUtil.ensureParameterNotNull(parameters, "parameters");
    6464        oauthProviderParameters = new OAuthParameters(parameters);
     
    7676     * @throws IllegalArgumentException thrown if requestToken is null
    7777     */
    78     public OsmOAuthAuthorisationClient(OAuthParameters parameters, OAuthToken requestToken) throws IllegalArgumentException {
     78    public OsmOAuthAuthorizationClient(OAuthParameters parameters, OAuthToken requestToken) throws IllegalArgumentException {
    7979        CheckParameterUtil.ensureParameterNotNull(parameters, "parameters");
    8080        oauthProviderParameters = new OAuthParameters(parameters);
     
    119119     * @param monitor a progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null
    120120     * @return the OAuth Request Token
    121      * @throws OsmOAuthAuthorisationException thrown if something goes wrong when retrieving the request token
    122      */
    123     public OAuthToken getRequestToken(ProgressMonitor monitor) throws OsmOAuthAuthorisationException, OsmTransferCancelledException {
     121     * @throws OsmOAuthAuthorizationException thrown if something goes wrong when retrieving the request token
     122     */
     123    public OAuthToken getRequestToken(ProgressMonitor monitor) throws OsmOAuthAuthorizationException, OsmTransferCancelledException {
    124124        if (monitor == null) {
    125125            monitor = NullProgressMonitor.INSTANCE;
     
    133133            if (canceled)
    134134                throw new OsmTransferCancelledException();
    135             throw new OsmOAuthAuthorisationException(e);
     135            throw new OsmOAuthAuthorizationException(e);
    136136        } catch(OAuthException e){
    137137            if (canceled)
    138138                throw new OsmTransferCancelledException();
    139             throw new OsmOAuthAuthorisationException(e);
     139            throw new OsmOAuthAuthorizationException(e);
    140140        } finally {
    141141            monitor.finishTask();
     
    151151     * @param monitor a progress monitor. Defaults to {@see NullProgressMonitor#INSTANCE} if null
    152152     * @return the OAuth Access Token
    153      * @throws OsmOAuthAuthorisationException thrown if something goes wrong when retrieving the request token
     153     * @throws OsmOAuthAuthorizationException thrown if something goes wrong when retrieving the request token
    154154     * @see #getRequestToken(ProgressMonitor)
    155155     */
    156     public OAuthToken getAccessToken(ProgressMonitor monitor) throws OsmOAuthAuthorisationException, OsmTransferCancelledException {
     156    public OAuthToken getAccessToken(ProgressMonitor monitor) throws OsmOAuthAuthorizationException, OsmTransferCancelledException {
    157157        if (monitor == null) {
    158158            monitor = NullProgressMonitor.INSTANCE;
     
    166166            if (canceled)
    167167                throw new OsmTransferCancelledException();
    168             throw new OsmOAuthAuthorisationException(e);
     168            throw new OsmOAuthAuthorizationException(e);
    169169        } catch(OAuthException e){
    170170            if (canceled)
    171171                throw new OsmTransferCancelledException();
    172             throw new OsmOAuthAuthorisationException(e);
     172            throw new OsmOAuthAuthorizationException(e);
    173173        } finally {
    174174            monitor.finishTask();
     
    219219    }
    220220
    221     protected String buildPostRequest(Map<String,String> parameters) throws OsmOAuthAuthorisationException {
     221    protected String buildPostRequest(Map<String,String> parameters) throws OsmOAuthAuthorizationException {
    222222        try {
    223223            StringBuilder sb = new StringBuilder();
     
    234234            return sb.toString();
    235235        } catch(UnsupportedEncodingException e) {
    236             throw new OsmOAuthAuthorisationException(e);
     236            throw new OsmOAuthAuthorizationException(e);
    237237        }
    238238    }
     
    242242     *
    243243     * @return the OSM login URL
    244      * @throws OsmOAuthAuthorisationException thrown if something went wrong, in particular if the
     244     * @throws OsmOAuthAuthorizationException thrown if something went wrong, in particular if the
    245245     * URLs are malformed
    246246     */
    247     public String buildOsmLoginUrl() throws OsmOAuthAuthorisationException{
     247    public String buildOsmLoginUrl() throws OsmOAuthAuthorizationException{
    248248        try {
    249249            URL autUrl = new URL(oauthProviderParameters.getAuthoriseUrl());
     
    254254            return url.toString();
    255255        } catch(MalformedURLException e) {
    256             throw new OsmOAuthAuthorisationException(e);
     256            throw new OsmOAuthAuthorizationException(e);
    257257        }
    258258    }
     
    262262     *
    263263     * @return the OSM logout URL
    264      * @throws OsmOAuthAuthorisationException thrown if something went wrong, in particular if the
     264     * @throws OsmOAuthAuthorizationException thrown if something went wrong, in particular if the
    265265     * URLs are malformed
    266266     */
    267     protected String buildOsmLogoutUrl() throws OsmOAuthAuthorisationException{
     267    protected String buildOsmLogoutUrl() throws OsmOAuthAuthorizationException{
    268268        try {
    269269            URL autUrl = new URL(oauthProviderParameters.getAuthoriseUrl());
     
    271271            return url.toString();
    272272        } catch(MalformedURLException e) {
    273             throw new OsmOAuthAuthorisationException(e);
     273            throw new OsmOAuthAuthorizationException(e);
    274274        }
    275275    }
     
    280280     *
    281281     * @return the session ID
    282      * @throws OsmOAuthAuthorisationException thrown if something went wrong
    283      */
    284     protected String fetchOsmWebsiteSessionId() throws OsmOAuthAuthorisationException {
     282     * @throws OsmOAuthAuthorizationException thrown if something went wrong
     283     */
     284    protected String fetchOsmWebsiteSessionId() throws OsmOAuthAuthorizationException {
    285285        try {
    286286            StringBuilder sb = new StringBuilder();
     
    297297            String sessionId = extractOsmSession(connection);
    298298            if (sessionId == null)
    299                 throw new OsmOAuthAuthorisationException(tr("OSM website did not return a session cookie in response to ''{0}'',", url.toString()));
     299                throw new OsmOAuthAuthorizationException(tr("OSM website did not return a session cookie in response to ''{0}'',", url.toString()));
    300300            return sessionId;
    301301        } catch(IOException e) {
    302             throw new OsmOAuthAuthorisationException(e);
     302            throw new OsmOAuthAuthorizationException(e);
    303303        } finally {
    304304            synchronized(this) {
     
    348348            int retCode = connection.getResponseCode();
    349349            if (retCode != HttpURLConnection.HTTP_MOVED_TEMP)
    350                 throw new OsmOAuthAuthorisationException(tr("Failed to authenticate user ''{0}'' with password ''***'' as OAuth user", userName));
    351         } catch(OsmOAuthAuthorisationException e) {
     350                throw new OsmOAuthAuthorizationException(tr("Failed to authenticate user ''{0}'' with password ''***'' as OAuth user", userName));
     351        } catch(OsmOAuthAuthorizationException e) {
    352352            throw new OsmLoginFailedException(e.getCause());
    353353        } catch(IOException e) {
     
    365365    }
    366366
    367     protected void logoutOsmSession(String sessionId) throws OsmOAuthAuthorisationException {
     367    protected void logoutOsmSession(String sessionId) throws OsmOAuthAuthorizationException {
    368368        try {
    369369            URL url = new URL(buildOsmLogoutUrl());
     
    377377            connection.connect();
    378378        }catch(MalformedURLException e) {
    379             throw new OsmOAuthAuthorisationException(e);
     379            throw new OsmOAuthAuthorizationException(e);
    380380        } catch(IOException e) {
    381             throw new OsmOAuthAuthorisationException(e);
     381            throw new OsmOAuthAuthorizationException(e);
    382382        }  finally {
    383383            synchronized(this) {
     
    387387    }
    388388
    389     protected void sendAuthorisationRequest(String sessionId, OAuthToken requestToken, OsmPrivileges privileges) throws OsmOAuthAuthorisationException {
     389    protected void sendAuthorisationRequest(String sessionId, OAuthToken requestToken, OsmPrivileges privileges) throws OsmOAuthAuthorizationException {
    390390        Map<String, String> parameters = new HashMap<String, String>();
    391391        parameters.put("oauth_token", requestToken.getKey());
     
    435435            int retCode = connection.getResponseCode();
    436436            if (retCode != HttpURLConnection.HTTP_MOVED_TEMP)
    437                 throw new OsmOAuthAuthorisationException(tr("Failed to authorise OAuth request  ''{0}''", requestToken.getKey()));
     437                throw new OsmOAuthAuthorizationException(tr("Failed to authorise OAuth request  ''{0}''", requestToken.getKey()));
    438438        } catch(MalformedURLException e) {
    439             throw new OsmOAuthAuthorisationException(e);
     439            throw new OsmOAuthAuthorizationException(e);
    440440        } catch(IOException e) {
    441             throw new OsmOAuthAuthorisationException(e);
     441            throw new OsmOAuthAuthorizationException(e);
    442442        } finally {
    443443            if (dout != null) {
     
    469469     * @throws IllegalArgumentException thrown if osmPassword is null
    470470     * @throws IllegalArgumentException thrown if privileges is null
    471      * @throws OsmOAuthAuthorisationException thrown if the authorisation fails
     471     * @throws OsmOAuthAuthorizationException thrown if the authorisation fails
    472472     * @throws OsmTransferCancelledException thrown if the task is cancelled by the user
    473473     */
    474     public void authorise(OAuthToken requestToken, String osmUserName, String osmPassword, OsmPrivileges privileges, ProgressMonitor monitor) throws IllegalArgumentException, OsmOAuthAuthorisationException, OsmTransferCancelledException{
     474    public void authorise(OAuthToken requestToken, String osmUserName, String osmPassword, OsmPrivileges privileges, ProgressMonitor monitor) throws IllegalArgumentException, OsmOAuthAuthorizationException, OsmTransferCancelledException{
    475475        CheckParameterUtil.ensureParameterNotNull(requestToken, "requestToken");
    476476        CheckParameterUtil.ensureParameterNotNull(osmUserName, "osmUserName");
     
    507507                throw new OsmTransferCancelledException();
    508508            monitor.worked(1);
    509         } catch(OsmOAuthAuthorisationException e) {
     509        } catch(OsmOAuthAuthorizationException e) {
    510510            if (canceled)
    511511                throw new OsmTransferCancelledException();
  • trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationException.java

    r2858 r2861  
    22package org.openstreetmap.josm.gui.oauth;
    33
    4 public class OsmOAuthAuthorisationException extends Exception {
     4public class OsmOAuthAuthorizationException extends Exception {
    55
    6     public OsmOAuthAuthorisationException() {
     6    public OsmOAuthAuthorizationException() {
    77        super();
    88    }
    99
    10     public OsmOAuthAuthorisationException(String arg0, Throwable arg1) {
     10    public OsmOAuthAuthorizationException(String arg0, Throwable arg1) {
    1111        super(arg0, arg1);
    1212    }
    1313
    14     public OsmOAuthAuthorisationException(String arg0) {
     14    public OsmOAuthAuthorizationException(String arg0) {
    1515        super(arg0);
    1616    }
    1717
    18     public OsmOAuthAuthorisationException(Throwable arg0) {
     18    public OsmOAuthAuthorizationException(Throwable arg0) {
    1919        super(arg0);
    2020    }
  • trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java

    r2801 r2861  
    2828    private OAuthToken accessToken;
    2929    private OAuthParameters parameters;
    30     private OsmOAuthAuthorisationClient client;
     30    private OsmOAuthAuthorizationClient client;
    3131    private OAuthToken requestToken;
    3232    private Component parent;
     
    6464    protected void finish() { /* not used in this task */}
    6565
    66     protected void alertRetrievingAccessTokenFailed(OsmOAuthAuthorisationException e) {
     66    protected void alertRetrievingAccessTokenFailed(OsmOAuthAuthorizationException e) {
    6767        HelpAwareOptionPane.showOptionDialog(
    6868                parent,
     
    8181        try {
    8282            synchronized(this) {
    83                 client = new OsmOAuthAuthorisationClient(parameters, requestToken);
     83                client = new OsmOAuthAuthorizationClient(parameters, requestToken);
    8484            }
    8585            accessToken = client.getAccessToken(getProgressMonitor().createSubTaskMonitor(0, false));
    8686        } catch(OsmTransferCancelledException e) {
    8787            return;
    88         } catch (OsmOAuthAuthorisationException e) {
     88        } catch (OsmOAuthAuthorizationException e) {
    8989            e.printStackTrace();
    9090            alertRetrievingAccessTokenFailed(e);
  • trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java

    r2801 r2861  
    2727    private OAuthToken requestToken;
    2828    private OAuthParameters parameters;
    29     private OsmOAuthAuthorisationClient client;
     29    private OsmOAuthAuthorizationClient client;
    3030    private Component parent;
    3131
     
    5858    protected void finish() { /* not used in this task */}
    5959
    60     protected void alertRetrievingRequestTokenFailed(OsmOAuthAuthorisationException e) {
     60    protected void alertRetrievingRequestTokenFailed(OsmOAuthAuthorizationException e) {
    6161        HelpAwareOptionPane.showOptionDialog(
    6262                parent,
     
    7575        try {
    7676            synchronized(this) {
    77                 client = new OsmOAuthAuthorisationClient(parameters);
     77                client = new OsmOAuthAuthorizationClient(parameters);
    7878            }
    7979            requestToken = client.getRequestToken(getProgressMonitor().createSubTaskMonitor(0, false));
    8080        } catch(OsmTransferCancelledException e) {
    8181            return;
    82         } catch (OsmOAuthAuthorisationException e) {
     82        } catch (OsmOAuthAuthorizationException e) {
    8383            e.printStackTrace();
    8484            alertRetrievingRequestTokenFailed(e);
  • trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java

    r2858 r2861  
    3838 * external browser for login and authorisation.
    3939 */
    40 public class SemiAutomaticAuthorisationUI extends AbstractAuthorisationUI {
     40public class SemiAutomaticAuthorizationUI extends AbstractAuthorizationUI {
    4141    private AccessTokenInfoPanel pnlAccessTokenInfo;
    4242    private OAuthToken requestToken;
     
    5858    }
    5959
    60     public SemiAutomaticAuthorisationUI() {
     60    public SemiAutomaticAuthorizationUI() {
    6161        build();
    6262    }
     
    6868
    6969    protected void transitionToRetrieveAccessToken() {
    70         OsmOAuthAuthorisationClient client = new OsmOAuthAuthorisationClient(
     70        OsmOAuthAuthorizationClient client = new OsmOAuthAuthorizationClient(
    7171                getAdvancedPropertiesPanel().getAdvancedParameters()
    7272        );
     
    374374        public void actionPerformed(ActionEvent evt) {
    375375            final RetrieveRequestTokenTask task = new RetrieveRequestTokenTask(
    376                     SemiAutomaticAuthorisationUI.this,
     376                    SemiAutomaticAuthorizationUI.this,
    377377                    getAdvancedPropertiesPanel().getAdvancedParameters()
    378378            );
     
    407407        public void actionPerformed(ActionEvent evt) {
    408408            final RetrieveAccessTokenTask task = new RetrieveAccessTokenTask(
    409                     SemiAutomaticAuthorisationUI.this,
     409                    SemiAutomaticAuthorizationUI.this,
    410410                    getAdvancedPropertiesPanel().getAdvancedParameters(),
    411411                    requestToken
     
    441441        public void actionPerformed(ActionEvent evt) {
    442442            TestAccessTokenTask task = new TestAccessTokenTask(
    443                     SemiAutomaticAuthorisationUI.this,
     443                    SemiAutomaticAuthorizationUI.this,
    444444                    getApiUrl(),
    445445                    getAdvancedPropertiesPanel().getAdvancedParameters(),
  • trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java

    r2850 r2861  
    9797    }
    9898
    99     protected UserInfo getUserDetails() throws OsmOAuthAuthorisationException, OsmDataParsingException,OsmTransferException {
     99    protected UserInfo getUserDetails() throws OsmOAuthAuthorizationException, OsmDataParsingException,OsmTransferException {
    100100        boolean authenticatorEnabled = true;
    101101        try {
     
    133133            throw new OsmTransferException(e);
    134134        } catch(OAuthException e) {
    135             throw new OsmOAuthAuthorisationException(e);
     135            throw new OsmOAuthAuthorizationException(e);
    136136        } finally {
    137137            DefaultAuthenticator.getInstance().setEnabled(authenticatorEnabled);
     
    253253            if (canceled) return;
    254254            notifySuccess(userInfo);
    255         }catch(OsmOAuthAuthorisationException e) {
     255        }catch(OsmOAuthAuthorizationException e) {
    256256            if (canceled) return;
    257257            e.printStackTrace();
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java

    r2849 r2861  
    3131import org.openstreetmap.josm.gui.SideButton;
    3232import org.openstreetmap.josm.gui.oauth.AdvancedOAuthPropertiesPanel;
    33 import org.openstreetmap.josm.gui.oauth.OAuthAuthorisationWizard;
     33import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
    3434import org.openstreetmap.josm.gui.oauth.TestAccessTokenTask;
    3535import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
     
    309309        }
    310310        public void actionPerformed(ActionEvent arg0) {
    311             OAuthAuthorisationWizard wizard = new OAuthAuthorisationWizard(
     311            OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
    312312                    OAuthAuthenticationPreferencesPanel.this,
    313313                    apiUrl
     
    334334        }
    335335        public void actionPerformed(ActionEvent arg0) {
    336             OAuthAuthorisationWizard wizard = new OAuthAuthorisationWizard(
     336            OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
    337337                    OAuthAuthenticationPreferencesPanel.this,
    338338                    apiUrl
Note: See TracChangeset for help on using the changeset viewer.