Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/io/auth
- Timestamp:
- 2015-06-20T23:42:21+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/auth
- Files:
-
- 4 edited
-
CredentialsAgentException.java (modified) (1 diff)
-
CredentialsManager.java (modified) (1 diff)
-
DefaultAuthenticator.java (modified) (1 diff)
-
JosmPreferencesCredentialAgent.java (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/auth/CredentialsAgentException.java
r4245 r8510 3 3 4 4 public class CredentialsAgentException extends Exception { 5 public CredentialsAgentException() {super();}6 public CredentialsAgentException(String message, Throwable cause) {super(message, cause);}7 public CredentialsAgentException(String message) {super(message);}8 public CredentialsAgentException(Throwable cause) {super(cause);}9 5 6 /** 7 * Constructs a new {@code CredentialsAgentException}. 8 * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method). 9 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 10 */ 11 public CredentialsAgentException(String message, Throwable cause) { 12 super(message, cause); 13 } 14 15 /** 16 * Constructs a new {@code CredentialsAgentException}. 17 * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method). 18 */ 19 public CredentialsAgentException(String message) { 20 super(message); 21 } 22 23 /** 24 * Constructs a new {@code CredentialsAgentException}. 25 * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). 26 */ 27 public CredentialsAgentException(Throwable cause) { 28 super(cause); 29 } 10 30 } -
trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
r8509 r8510 118 118 if (requestorType == RequestorType.SERVER && Objects.equals(OsmApi.getOsmApi().getHost(), host)) { 119 119 String username = credentials.getUserName(); 120 if(username != null && !username.trim().isEmpty()) { 120 if (username != null && !username.trim().isEmpty()) { 121 121 JosmUserIdentityManager.getInstance().setPartiallyIdentified(username); 122 122 } -
trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
r8388 r8510 57 57 credentialsTried.put(getRequestorType(), true); 58 58 return new PasswordAuthentication(response.getUsername(), response.getPassword()); 59 } catch(CredentialsAgentException e) { 59 } catch (CredentialsAgentException e) { 60 60 Main.error(e); 61 61 return null; -
trunk/src/org/openstreetmap/josm/io/auth/JosmPreferencesCredentialAgent.java
r8509 r8510 28 28 */ 29 29 @Override 30 public PasswordAuthentication lookup(RequestorType requestorType, String host) throws CredentialsAgentException{ 30 public PasswordAuthentication lookup(RequestorType requestorType, String host) throws CredentialsAgentException { 31 31 if (requestorType == null) 32 32 return null; … … 38 38 user = Main.pref.get("osm-server.username", null); 39 39 password = Main.pref.get("osm-server.password", null); 40 } else if(host != null) { 40 } else if (host != null) { 41 41 user = Main.pref.get("server.username."+host, null); 42 42 password = Main.pref.get("server.password."+host, null); … … 74 74 Main.pref.put("osm-server.password", String.valueOf(credentials.getPassword())); 75 75 } 76 } else if(host != null) { 76 } else if (host != null) { 77 77 Main.pref.put("server.username."+host, credentials.getUserName()); 78 78 if (credentials.getPassword() == null) { … … 130 130 public Component getPreferencesDecorationPanel() { 131 131 HtmlPanel pnlMessage = new HtmlPanel(); 132 HTMLEditorKit kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit(); 132 HTMLEditorKit kit = (HTMLEditorKit) pnlMessage.getEditorPane().getEditorKit(); 133 133 kit.getStyleSheet().addRule( 134 ".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}");135 pnlMessage.setText(136 tr(134 ".warning-body {background-color:rgb(253,255,221);padding: 10pt; " + 135 "border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}"); 136 pnlMessage.setText(tr( 137 137 "<html><body>" 138 138 + "<p class=\"warning-body\">"
Note:
See TracChangeset
for help on using the changeset viewer.
