- Timestamp:
- 2009-12-16T18:58:04+01:00 (15 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 14 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r2477 r2641 22 22 import org.openstreetmap.josm.io.OsmServerLocationReader; 23 23 import org.openstreetmap.josm.io.OsmServerReader; 24 import org.openstreetmap.josm.io.OsmTransferCancelledException; 24 25 import org.openstreetmap.josm.io.OsmTransferException; 25 26 import org.xml.sax.SAXException; … … 94 95 return; 95 96 } 96 if (e instanceof OsmTransferException) { 97 if (e instanceof OsmTransferCancelledException) { 98 setCanceled(true); 99 return; 100 } else if (e instanceof OsmTransferException) { 97 101 rememberException(e); 98 102 } else { -
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r2598 r2641 17 17 import org.openstreetmap.josm.io.OsmApi; 18 18 import org.openstreetmap.josm.io.OsmApiInitializationException; 19 import org.openstreetmap.josm.io.OsmTransferCancelledException; 19 20 20 21 public class ApiPreconditionCheckerHook implements UploadHook { … … 38 39 return false; 39 40 } 41 } catch(OsmTransferCancelledException e){ 42 return false; 40 43 } catch (OsmApiInitializationException e) { 41 44 ExceptionDialogUtil.explainOsmTransferException(e); -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r2620 r2641 26 26 import java.util.Map.Entry; 27 27 import java.util.concurrent.CopyOnWriteArrayList; 28 import java.util.logging.Logger; 28 29 import java.util.regex.Matcher; 29 30 import java.util.regex.Pattern; … … 32 33 33 34 import org.openstreetmap.josm.Main; 34 import org.openstreetmap.josm.gui.preferences.ProxyPreferences;35 35 import org.openstreetmap.josm.tools.ColorHelper; 36 36 … … 44 44 */ 45 45 public class Preferences { 46 static private final Logger logger = Logger.getLogger(Preferences.class.getName()); 46 47 47 48 /** … … 731 732 public void updateSystemProperties() { 732 733 Properties sysProp = System.getProperties(); 733 if (getBoolean(ProxyPreferences.PROXY_ENABLE)) {734 sysProp.put("proxySet", "true");735 sysProp.put("http.proxyHost", get(ProxyPreferences.PROXY_HOST));736 sysProp.put("proxyPort", get(ProxyPreferences.PROXY_PORT));737 if (!getBoolean(ProxyPreferences.PROXY_ANONYMOUS)) {738 sysProp.put("proxyUser", get(ProxyPreferences.PROXY_USER));739 sysProp.put("proxyPassword", get(ProxyPreferences.PROXY_PASS));740 }741 742 }743 734 sysProp.put("http.agent", Version.getInstance().getAgentString()); 744 735 System.setProperties(sysProp); -
trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
r2512 r2641 25 25 26 26 import org.openstreetmap.josm.Main; 27 import org.openstreetmap.josm.data.Preferences.Bookmark;28 27 import org.openstreetmap.josm.io.OsmConnection; 28 import org.openstreetmap.josm.io.OsmTransferException; 29 29 import org.openstreetmap.josm.io.XmlWriter; 30 30 import org.openstreetmap.josm.tools.Base64; … … 66 66 return b.toString(); 67 67 } catch (IOException e) { 68 e.printStackTrace(); 69 } catch(OsmTransferException e) { 68 70 e.printStackTrace(); 69 71 } -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r2358 r2641 9 9 import java.awt.event.WindowAdapter; 10 10 import java.awt.event.WindowEvent; 11 import java.net.Authenticator; 12 import java.net.ProxySelector; 11 13 import java.util.Arrays; 12 14 import java.util.Collection; … … 19 21 20 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.io.DefaultProxySelector; 24 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory; 25 import org.openstreetmap.josm.io.auth.DefaultAuthenticator; 21 26 import org.openstreetmap.josm.plugins.PluginHandler; 22 27 import org.openstreetmap.josm.tools.BugReportExceptionHandler; … … 97 102 } 98 103 Main.pref.updateSystemProperties(); 104 105 Authenticator.setDefault( 106 new DefaultAuthenticator( 107 CredentialsManagerFactory.getCredentialManager() 108 ) 109 ); 110 ProxySelector.setDefault(new DefaultProxySelector(ProxySelector.getDefault())); 99 111 100 112 if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) { -
trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
r2613 r2641 29 29 import org.openstreetmap.josm.io.OsmApiPrimitiveGoneException; 30 30 import org.openstreetmap.josm.io.OsmServerWriter; 31 import org.openstreetmap.josm.io.OsmTransferCancelledException; 31 32 import org.openstreetmap.josm.io.OsmTransferException; 32 33 import org.openstreetmap.josm.tools.ImageProvider; … … 239 240 // 240 241 break; 242 } catch(OsmTransferCancelledException e) { 243 uploadCancelled = true; 244 return; 241 245 } catch(OsmApiPrimitiveGoneException e) { 242 246 // try to recover from 410 Gone -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r2535 r2641 44 44 // some common tabs 45 45 public final JPanel display = createPreferenceTab("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program.")); 46 public final JPanel connection = createPreferenceTab("connection", I18n.tr("Connection Settings"), I18n.tr("Connection Settings for the OSM server."), true);46 public final JPanel connection = createPreferenceTab("connection", I18n.tr("Connection Settings"), I18n.tr("Connection Settings for the OSM server."),false); 47 47 public final JPanel map = createPreferenceTab("map", I18n.tr("Map Settings"), I18n.tr("Settings for the map projection and data interpretation.")); 48 48 public final JPanel audio = createPreferenceTab("audio", I18n.tr("Audio Settings"), I18n.tr("Settings for the audio player and audio markers.")); -
trunk/src/org/openstreetmap/josm/gui/preferences/ProxyPreferences.java
r1742 r2641 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.event.ActionEvent; 7 import java.awt.event.ActionListener; 8 9 import javax.swing.Box; 10 import javax.swing.JCheckBox; 6 import java.awt.Dimension; 7 import java.awt.GridBagConstraints; 8 import java.awt.GridBagLayout; 9 import java.awt.Insets; 10 import java.awt.event.ItemEvent; 11 import java.awt.event.ItemListener; 12 import java.net.ProxySelector; 13 import java.util.HashMap; 14 import java.util.Map; 15 16 import javax.swing.ButtonGroup; 11 17 import javax.swing.JLabel; 18 import javax.swing.JPanel; 12 19 import javax.swing.JPasswordField; 20 import javax.swing.JRadioButton; 13 21 import javax.swing.JSeparator; 14 22 import javax.swing.JTextField; … … 16 24 17 25 import org.openstreetmap.josm.Main; 26 import org.openstreetmap.josm.gui.JMultilineLabel; 27 import org.openstreetmap.josm.io.DefaultProxySelector; 18 28 import org.openstreetmap.josm.tools.GBC; 19 29 20 30 public class ProxyPreferences implements PreferenceSetting { 31 32 21 33 22 34 public static class Factory implements PreferenceSettingFactory { … … 26 38 } 27 39 28 public static final String PROXY_ENABLE = "proxy.enable"; 29 public static final String PROXY_HOST = "proxy.host"; 30 public static final String PROXY_PORT = "proxy.port"; 31 public static final String PROXY_ANONYMOUS = "proxy.anonymous"; 40 public enum ProxyPolicy { 41 NO_PROXY("no-proxy"), 42 USE_SYSTEM_SETTINGS("use-system-settings"), 43 USE_HTTP_PROXY("use-http-proxy"), 44 USE_SOCKS_PROXY("use-socks-proxy"); 45 46 private String policyName; 47 ProxyPolicy(String policyName) { 48 this.policyName = policyName; 49 } 50 51 public String getName() { 52 return policyName; 53 } 54 55 static public ProxyPolicy fromName(String policyName) { 56 if (policyName == null) return null; 57 policyName = policyName.trim().toLowerCase(); 58 for(ProxyPolicy pp: values()) { 59 if (pp.getName().equals(policyName)) 60 return pp; 61 } 62 return null; 63 } 64 } 65 66 public static final String PROXY_POLICY = "proxy.policy"; 67 public static final String PROXY_HTTP_HOST = "proxy.http.host"; 68 public static final String PROXY_HTTP_PORT = "proxy.http.port"; 69 public static final String PROXY_SOCKS_HOST = "proxy.socks.host"; 70 public static final String PROXY_SOCKS_PORT = "proxy.socks.port"; 32 71 public static final String PROXY_USER = "proxy.user"; 33 72 public static final String PROXY_PASS = "proxy.pass"; 34 73 35 private JCheckBox proxyEnable = new JCheckBox(tr("Enable proxy server")); 36 private JTextField proxyHost = new JTextField(20); 37 private JTextField proxyPort = new JTextField(5); 38 private JCheckBox proxyAnonymous = new JCheckBox(tr("Anonymous")); 39 private JTextField proxyUser = new JTextField(20); 40 private JPasswordField proxyPass = new JPasswordField(20); 74 private ButtonGroup bgProxyPolicy; 75 private Map<ProxyPolicy, JRadioButton> rbProxyPolicy; 76 private JTextField tfProxyHttpHost; 77 private JTextField tfProxyHttpPort; 78 private JTextField tfProxySocksHost; 79 private JTextField tfProxySocksPort; 80 private JTextField tfProxyHttpUser; 81 private JPasswordField tfProxyHttpPassword; 82 83 protected JPanel buildHttpProxyConfigurationPanel() { 84 JPanel pnl = new JPanel(new GridBagLayout()) { 85 @Override 86 public Dimension getMinimumSize() { 87 return getPreferredSize(); 88 } 89 }; 90 GridBagConstraints gc = new GridBagConstraints(); 91 92 gc.anchor = GridBagConstraints.WEST; 93 gc.insets = new Insets(5,5,0,0); 94 pnl.add(new JLabel("Host:"), gc); 95 96 gc.gridx = 1; 97 pnl.add(tfProxyHttpHost = new JTextField(20),gc); 98 99 gc.gridy = 1; 100 gc.gridx = 0; 101 pnl.add(new JLabel("Port:"), gc); 102 103 gc.gridx = 1; 104 gc.weightx = 0.0; 105 pnl.add(tfProxyHttpPort = new JTextField(5),gc); 106 107 gc.gridy = 2; 108 gc.gridx = 0; 109 gc.gridwidth = 2; 110 gc.fill = GridBagConstraints.BOTH; 111 gc.weightx = 1.0; 112 gc.weighty = 1.0; 113 pnl.add(new JMultilineLabel(tr("Please enter a username and a password if your proxy requires authentication.")), gc); 114 115 gc.gridy = 3; 116 gc.gridx = 0; 117 gc.gridwidth = 1; 118 gc.weightx = 0.0; 119 gc.fill = GridBagConstraints.NONE; 120 pnl.add(new JLabel("User:"), gc); 121 122 gc.gridy = 3; 123 gc.gridx = 1; 124 pnl.add(tfProxyHttpUser = new JTextField(20),gc); 125 126 gc.gridy = 4; 127 gc.gridx = 0; 128 pnl.add(new JLabel("Password:"), gc); 129 130 gc.gridx = 1; 131 pnl.add(tfProxyHttpPassword = new JPasswordField(20),gc); 132 return pnl; 133 } 134 135 protected JPanel buildSocksProxyConfigurationPanel() { 136 JPanel pnl = new JPanel(new GridBagLayout()) { 137 @Override 138 public Dimension getMinimumSize() { 139 return getPreferredSize(); 140 } 141 }; 142 GridBagConstraints gc = new GridBagConstraints(); 143 gc.anchor = GridBagConstraints.WEST; 144 gc.insets = new Insets(5,5,0,0); 145 pnl.add(new JLabel("Host:"), gc); 146 147 gc.gridx = 1; 148 pnl.add(tfProxySocksHost = new JTextField(20),gc); 149 150 gc.gridy = 1; 151 gc.gridx = 0; 152 pnl.add(new JLabel("Port:"), gc); 153 154 gc.gridx = 1; 155 pnl.add(tfProxySocksPort = new JTextField(5),gc); 156 157 // add an extra spacer, otherwise the layout is broken 158 gc.gridy = 2; 159 gc.gridx = 0; 160 gc.gridwidth = 2; 161 gc.fill = GridBagConstraints.BOTH; 162 gc.weightx = 1.0; 163 gc.weighty = 1.0; 164 pnl.add(new JPanel(), gc); 165 return pnl; 166 } 167 168 protected JPanel buildProxySettingsPanel() { 169 JPanel pnl = new JPanel(new GridBagLayout()); 170 GridBagConstraints gc = new GridBagConstraints(); 171 172 bgProxyPolicy = new ButtonGroup(); 173 rbProxyPolicy = new HashMap<ProxyPolicy, JRadioButton>(); 174 ProxyPolicyChangeListener policyChangeListener = new ProxyPolicyChangeListener(); 175 for (ProxyPolicy pp: ProxyPolicy.values()) { 176 rbProxyPolicy.put(pp, new JRadioButton()); 177 bgProxyPolicy.add(rbProxyPolicy.get(pp)); 178 rbProxyPolicy.get(pp).addItemListener(policyChangeListener); 179 } 180 gc.gridx = 0; 181 gc.gridy = 0; 182 gc.fill = GridBagConstraints.NONE; 183 gc.anchor = GridBagConstraints.FIRST_LINE_START; 184 pnl.add(rbProxyPolicy.get(ProxyPolicy.NO_PROXY),gc); 185 gc.gridx = 1; 186 gc.fill = GridBagConstraints.HORIZONTAL; 187 gc.weightx = 1.0; 188 pnl.add(new JLabel(tr("No proxy")), gc); 189 190 gc.gridx = 0; 191 gc.gridy = 1; 192 gc.fill = GridBagConstraints.NONE; 193 gc.anchor = GridBagConstraints.FIRST_LINE_START; 194 pnl.add(rbProxyPolicy.get(ProxyPolicy.USE_SYSTEM_SETTINGS),gc); 195 gc.gridx = 1; 196 gc.fill = GridBagConstraints.HORIZONTAL; 197 gc.weightx = 1.0; 198 gc.weighty = 0.0; 199 String msg; 200 if (DefaultProxySelector.willJvmRetrieveSystemProxies()) { 201 msg = tr("Use standard system settings"); 202 } else { 203 msg = tr("Use standard system settings (disabled. Start JOSM with <tt>-Djava.net.useSystemProxies=true</tt> to enable)"); 204 } 205 pnl.add(new JMultilineLabel("<html>" + msg + "</html>"), gc); 206 207 gc.gridx = 0; 208 gc.gridy = 2; 209 gc.fill = GridBagConstraints.NONE; 210 gc.anchor = GridBagConstraints.FIRST_LINE_START; 211 pnl.add(rbProxyPolicy.get(ProxyPolicy.USE_HTTP_PROXY),gc); 212 gc.gridx = 1; 213 gc.fill = GridBagConstraints.HORIZONTAL; 214 gc.weightx = 1.0; 215 pnl.add(new JLabel(tr("Manually configure a HTTP proxy")),gc); 216 217 gc.gridx = 1; 218 gc.gridy = 3; 219 gc.fill = GridBagConstraints.HORIZONTAL; 220 gc.weightx = 1.0; 221 gc.weighty = 0.0; 222 pnl.add(buildHttpProxyConfigurationPanel(),gc); 223 224 gc.gridx = 0; 225 gc.gridy = 4; 226 gc.fill = GridBagConstraints.NONE; 227 gc.anchor = GridBagConstraints.FIRST_LINE_START; 228 pnl.add(rbProxyPolicy.get(ProxyPolicy.USE_SOCKS_PROXY),gc); 229 gc.gridx = 1; 230 gc.fill = GridBagConstraints.HORIZONTAL; 231 gc.weightx = 1.0; 232 pnl.add(new JLabel(tr("Use a SOCKS proxy")),gc); 233 234 gc.gridx = 1; 235 gc.gridy = 5; 236 gc.fill = GridBagConstraints.BOTH; 237 gc.anchor = GridBagConstraints.WEST; 238 gc.weightx = 1.0; 239 gc.weighty = 0.0; 240 pnl.add(buildSocksProxyConfigurationPanel(),gc); 241 242 return pnl; 243 } 244 245 protected void initFromPreferences() { 246 String policy = Main.pref.get(PROXY_POLICY, null); 247 ProxyPolicy pp = ProxyPolicy.fromName(policy); 248 pp = pp == null? ProxyPolicy.NO_PROXY: pp; 249 rbProxyPolicy.get(pp).setSelected(true); 250 String value = Main.pref.get("proxy.host", null); 251 if (value != null) { 252 // legacy support 253 tfProxyHttpHost.setText(value); 254 Main.pref.put("proxy.host", null); 255 } else { 256 tfProxyHttpHost.setText(Main.pref.get(PROXY_HTTP_HOST, "")); 257 } 258 value = Main.pref.get("proxy.port", null); 259 if (value != null) { 260 // legacy support 261 tfProxyHttpPort.setText(value); 262 Main.pref.put("proxy.port", null); 263 } else { 264 tfProxyHttpPort.setText(Main.pref.get(PROXY_HTTP_PORT, "")); 265 } 266 tfProxySocksHost.setText(Main.pref.get(PROXY_SOCKS_HOST, "")); 267 tfProxySocksPort.setText(Main.pref.get(PROXY_SOCKS_PORT, "")); 268 tfProxyHttpUser.setText(Main.pref.get(PROXY_USER, "")); 269 tfProxyHttpPassword.setText(Main.pref.get(PROXY_PASS, "")); 270 271 if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && ! DefaultProxySelector.willJvmRetrieveSystemProxies()) { 272 System.err.println(tr("Warning: JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''")); 273 pp = ProxyPolicy.NO_PROXY; 274 rbProxyPolicy.get(pp).setSelected(true); 275 } 276 } 277 278 protected void updateEnabledState() { 279 tfProxyHttpHost.setEnabled(rbProxyPolicy.get(ProxyPolicy.USE_HTTP_PROXY).isSelected()); 280 tfProxyHttpPort.setEnabled(rbProxyPolicy.get(ProxyPolicy.USE_HTTP_PROXY).isSelected()); 281 tfProxyHttpUser.setEnabled(rbProxyPolicy.get(ProxyPolicy.USE_HTTP_PROXY).isSelected()); 282 tfProxyHttpPassword.setEnabled(rbProxyPolicy.get(ProxyPolicy.USE_HTTP_PROXY).isSelected()); 283 tfProxySocksHost.setEnabled(rbProxyPolicy.get(ProxyPolicy.USE_SOCKS_PROXY).isSelected()); 284 tfProxySocksPort.setEnabled(rbProxyPolicy.get(ProxyPolicy.USE_SOCKS_PROXY).isSelected()); 285 286 rbProxyPolicy.get(ProxyPolicy.USE_SYSTEM_SETTINGS).setEnabled(DefaultProxySelector.willJvmRetrieveSystemProxies()); 287 } 288 289 class ProxyPolicyChangeListener implements ItemListener { 290 public void itemStateChanged(ItemEvent arg0) { 291 updateEnabledState(); 292 } 293 } 41 294 42 295 public void addGui(PreferenceDialog gui) { 43 proxyEnable.setSelected(Main.pref.getBoolean(PROXY_ENABLE));44 proxyEnable.addActionListener(new ActionListener(){45 public void actionPerformed(ActionEvent e) {46 proxyHost.setEnabled(proxyEnable.isSelected());47 proxyPort.setEnabled(proxyEnable.isSelected());48 proxyAnonymous.setEnabled(proxyEnable.isSelected());49 proxyUser.setEnabled(proxyEnable.isSelected() && !proxyAnonymous.isSelected());50 proxyPass.setEnabled(proxyEnable.isSelected() && !proxyAnonymous.isSelected());51 }52 });53 proxyHost.setEnabled(Main.pref.getBoolean(PROXY_ENABLE));54 proxyHost.setText(Main.pref.get(PROXY_HOST));55 proxyPort.setEnabled(Main.pref.getBoolean(PROXY_ENABLE));56 proxyPort.setText(Main.pref.get(PROXY_PORT));57 proxyAnonymous.setEnabled(Main.pref.getBoolean(PROXY_ENABLE));58 proxyAnonymous.setSelected(Main.pref.getBoolean(PROXY_ANONYMOUS));59 proxyAnonymous.addActionListener(new ActionListener(){60 public void actionPerformed(ActionEvent e) {61 proxyUser.setEnabled(proxyEnable.isSelected() && !proxyAnonymous.isSelected());62 proxyPass.setEnabled(proxyEnable.isSelected() && !proxyAnonymous.isSelected());63 }64 });65 proxyUser.setEnabled(Main.pref.getBoolean(PROXY_ENABLE) && (Main.pref.getBoolean(PROXY_ANONYMOUS)));66 proxyUser.setText(Main.pref.get(PROXY_USER));67 proxyPass.setEnabled(Main.pref.getBoolean(PROXY_ENABLE) && (Main.pref.getBoolean(PROXY_ANONYMOUS)));68 proxyPass.setText(Main.pref.get(PROXY_USER));69 70 296 gui.connection.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL)); 71 297 gui.connection.add(new JLabel(tr("Proxy Settings")), GBC.eol()); 72 gui.connection.add(proxyEnable, GBC.eol().insets(20, 0, 0, 0)); 73 gui.connection.add(new JLabel(tr("Proxy server host")), GBC.std()); 74 gui.connection.add(proxyHost, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 75 gui.connection.add(new JLabel(tr("Proxy server port")), GBC.std()); 76 gui.connection.add(proxyPort, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 77 gui.connection.add(proxyAnonymous, GBC.eop().insets(20, 0, 0, 0)); 78 gui.connection.add(new JLabel(tr("Proxy server username")), GBC.std()); 79 gui.connection.add(proxyUser, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 80 gui.connection.add(new JLabel(tr("Proxy server password")), GBC.std()); 81 gui.connection.add(proxyPass, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 82 83 gui.connection.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 298 gui.connection.add(buildProxySettingsPanel(), GBC.eol().insets(20,10,0,0)); 299 300 initFromPreferences(); 301 updateEnabledState(); 84 302 } 85 303 86 304 public boolean ok() { 87 Main.pref.put(PROXY_ENABLE, proxyEnable.isSelected()); 88 Main.pref.put(PROXY_HOST, proxyHost.getText()); 89 Main.pref.put(PROXY_PORT, proxyPort.getText()); 90 Main.pref.put(PROXY_ANONYMOUS, proxyAnonymous.isSelected()); 91 Main.pref.put(PROXY_USER, proxyUser.getText()); 92 Main.pref.put(PROXY_PASS, new String(proxyPass.getPassword())); 305 ProxyPolicy policy = null; 306 for (ProxyPolicy pp: ProxyPolicy.values()) { 307 if (rbProxyPolicy.get(pp).isSelected()) { 308 policy = pp; 309 break; 310 } 311 } 312 if (policy == null) { 313 policy = ProxyPolicy.NO_PROXY; 314 } 315 Main.pref.put(PROXY_POLICY, policy.getName()); 316 Main.pref.put(PROXY_HTTP_HOST, tfProxyHttpHost.getText()); 317 Main.pref.put(PROXY_HTTP_PORT, tfProxyHttpPort.getText()); 318 Main.pref.put(PROXY_SOCKS_HOST, tfProxySocksHost.getText()); 319 Main.pref.put(PROXY_SOCKS_PORT, tfProxySocksPort.getText()); 320 Main.pref.put(PROXY_USER, tfProxyHttpUser.getText()); 321 Main.pref.put(PROXY_PASS, String.valueOf(tfProxyHttpPassword.getPassword())); 322 323 // remove these legacy property keys 324 Main.pref.put("proxy.anonymous", null); 325 Main.pref.put("proxy.enable", null); 326 327 // update the proxy selector 328 ProxySelector selector = ProxySelector.getDefault(); 329 if (selector instanceof DefaultProxySelector) { 330 ((DefaultProxySelector)selector).initFromPreferences(); 331 } 93 332 return false; 94 333 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ServerAccessPreference.java
r2017 r2641 2 2 package org.openstreetmap.josm.gui.preferences; 3 3 4 import org.openstreetmap.josm.io.CredentialsManager; 5 import org.openstreetmap.josm.io.OsmConnection; 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import java.awt.Font; 7 import java.net.PasswordAuthentication; 8 import java.net.Authenticator.RequestorType; 9 10 import javax.swing.JLabel; 11 import javax.swing.JPasswordField; 12 import javax.swing.JTextField; 13 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.io.auth.CredentialsManager; 16 import org.openstreetmap.josm.io.auth.CredentialsManagerException; 17 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory; 18 import org.openstreetmap.josm.tools.GBC; 6 19 7 20 public class ServerAccessPreference implements PreferenceSetting { … … 14 27 15 28 /** 16 * Provide username and password input editfields. 17 * Store the values if user hits OK. 29 * Editfield for the Base url to the REST API from OSM. 18 30 */ 19 private CredentialsManager.PreferenceAdditions credentialsPA = OsmConnection.credentialsManager.newPreferenceAdditions(); 31 final private JTextField osmDataServerURL = new JTextField(20); 32 /** 33 * Editfield for the username to the OSM account. 34 */ 35 final private JTextField osmDataUsername = new JTextField(20); 36 /** 37 * Passwordfield for the userpassword of the REST API. 38 */ 39 final private JPasswordField osmDataPassword = new JPasswordField(20); 20 40 21 41 public void addGui(PreferenceDialog gui) { 22 credentialsPA.addPreferenceOptions(gui.connection); 42 CredentialsManager cm = CredentialsManagerFactory.getCredentialManager(); 43 String oldServerURL = Main.pref.get("osm-server.url", "http://api.openstreetmap.org/api"); 44 String oldUsername; 45 String oldPassword; 46 try { 47 PasswordAuthentication credentials = cm.lookup(RequestorType.SERVER); 48 oldUsername = (credentials == null | credentials.getUserName() == null) ? "" : credentials.getUserName(); 49 oldPassword = (credentials == null | credentials.getPassword() == null) ? "" : String.valueOf(credentials.getPassword()); 50 } catch(CredentialsManagerException e) { 51 e.printStackTrace(); 52 oldUsername = ""; 53 oldPassword = ""; 54 } 55 56 osmDataServerURL.setText(oldServerURL); 57 osmDataUsername.setText(oldUsername); 58 osmDataPassword.setText(oldPassword); 59 osmDataServerURL.setToolTipText(tr("The base URL for the OSM server (REST API)")); 60 osmDataUsername.setToolTipText(tr("Login name (e-mail) to the OSM account.")); 61 osmDataPassword.setToolTipText(tr("Login password to the OSM account. Leave blank to not store any password.")); 62 63 gui.connection.add(new JLabel(tr("Base Server URL")), GBC.std()); 64 gui.connection.add(osmDataServerURL, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 65 gui.connection.add(new JLabel(tr("OSM username (e-mail)")), GBC.std()); 66 gui.connection.add(osmDataUsername, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 67 gui.connection.add(new JLabel(tr("OSM password")), GBC.std()); 68 gui.connection.add(osmDataPassword, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,0)); 69 JLabel warning = new JLabel(tr("<html>" + 70 "WARNING: The password is stored in plain text in the preferences file.<br>" + 71 "The password is transferred in plain text to the server, encoded in the URL.<br>" + 72 "<b>Do not use a valuable Password.</b></html>")); 73 warning.setFont(warning.getFont().deriveFont(Font.ITALIC)); 74 gui.connection.add(warning, GBC.eop().fill(GBC.HORIZONTAL)); 23 75 } 24 76 25 77 public boolean ok() { 26 credentialsPA.preferencesChanged(); 78 CredentialsManager cm = CredentialsManagerFactory.getCredentialManager(); 79 Main.pref.put("osm-server.url", osmDataServerURL.getText()); 80 try { 81 cm.store(RequestorType.SERVER, new PasswordAuthentication( 82 osmDataUsername.getText(), 83 osmDataPassword.getPassword() 84 )); 85 } catch(CredentialsManagerException e) { 86 // FIXME: Message dialog with an error message? 87 e.printStackTrace(); 88 } 27 89 return false; 28 90 } -
trunk/src/org/openstreetmap/josm/io/MultiPartFormOutputStream.java
r2626 r2641 92 92 this.out = new DataOutputStream(os); 93 93 this.boundary = boundary; 94 initAuthentication();95 94 } 96 95 -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r2604 r2641 23 23 import java.util.HashMap; 24 24 25 import javax.xml.parsers.ParserConfigurationException; 25 26 import javax.xml.parsers.SAXParserFactory; 26 27 … … 147 148 * @exception OsmApiInitializationException thrown, if an exception occurs 148 149 */ 149 public void initialize(ProgressMonitor monitor) throws OsmApiInitializationException {150 public void initialize(ProgressMonitor monitor) throws OsmApiInitializationException, OsmTransferCancelledException { 150 151 if (initialized) 151 152 return; 152 153 cancel = false; 153 initAuthentication();154 154 try { 155 155 String s = sendRequest("GET", "capabilities", null,monitor, false); … … 169 169 osmWriter.setVersion(version); 170 170 initialized = true; 171 } catch (Exception ex) {171 } catch(IOException e) { 172 172 initialized = false; 173 throw new OsmApiInitializationException(ex); 173 throw new OsmApiInitializationException(e); 174 } catch(SAXException e) { 175 initialized = false; 176 throw new OsmApiInitializationException(e); 177 } catch(ParserConfigurationException e) { 178 initialized = false; 179 throw new OsmApiInitializationException(e); 180 } catch(OsmTransferCancelledException e){ 181 throw e; 182 } catch(OsmTransferException e) { 183 initialized = false; 184 throw new OsmApiInitializationException(e); 174 185 } 175 186 } … … 436 447 monitor.setCustomText(tr("Starting retry {0} of {1} in {2} seconds ...", getMaxRetries() - retry,getMaxRetries(), 10-i)); 437 448 } 438 if (cancel || isAuthCancelled())449 if (cancel) 439 450 throw new OsmTransferCancelledException(); 440 451 try { … … 563 574 case HttpURLConnection.HTTP_GONE: 564 575 throw new OsmApiPrimitiveGoneException(errorHeader, errorBody); 576 case HttpURLConnection.HTTP_UNAUTHORIZED: 577 case HttpURLConnection.HTTP_PROXY_AUTH: 578 // if we get here with HTTP_UNAUTHORIZED or HTTP_PROXY_AUTH the user canceled the 579 // username/password dialog. Throw an OsmTransferCancelledException. 580 // 581 throw new OsmTransferCancelledException(); 565 582 case HttpURLConnection.HTTP_CONFLICT: 566 583 if (ChangesetClosedException.errorHeaderMatchesPattern(errorHeader)) … … 583 600 } 584 601 throw new OsmTransferException(e); 602 } catch(IOException e){ 603 throw new OsmTransferException(e); 604 } catch(OsmTransferCancelledException e){ 605 throw e; 585 606 } catch(OsmTransferException e) { 586 607 throw e; 587 } catch (Exception e) {588 throw new OsmTransferException(e);589 608 } 590 609 } -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r2512 r2641 2 2 package org.openstreetmap.josm.io; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 6 import java.awt.Font;7 import java.awt.GridBagLayout;8 import java.net.Authenticator;9 4 import java.net.HttpURLConnection; 10 import java.net. PasswordAuthentication;5 import java.net.Authenticator.RequestorType; 11 6 import java.nio.ByteBuffer; 12 7 import java.nio.CharBuffer; … … 16 11 import java.util.logging.Logger; 17 12 18 import javax.swing.JCheckBox; 19 import javax.swing.JLabel; 20 import javax.swing.JPanel; 21 import javax.swing.JPasswordField; 22 import javax.swing.JTextField; 23 24 import org.openstreetmap.josm.Main; 25 import org.openstreetmap.josm.gui.ExtendedDialog; 13 import org.openstreetmap.josm.io.auth.CredentialsManagerException; 14 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory; 15 import org.openstreetmap.josm.io.auth.CredentialsManagerResponse; 26 16 import org.openstreetmap.josm.tools.Base64; 27 import org.openstreetmap.josm.tools.GBC;28 17 29 18 /** … … 38 27 protected boolean cancel = false; 39 28 protected HttpURLConnection activeConnection; 40 /**41 * Handles password storage and some related gui-components.42 * It can be set by a plugin. This may happen at startup and43 * by changing the preferences.44 * Syncronize on this object to get or set a consistent45 * username/password pair.46 */47 public static CredentialsManager credentialsManager = new PlainCredentialsManager();48 49 private static OsmAuth authentication = new OsmAuth();50 29 51 30 /** … … 53 32 */ 54 33 static { 55 // TODO: current authentication handling is sub-optimal in that it seems to use the same authenticator for56 // any kind of request. HTTP requests executed by plugins, e.g. to password-protected WMS servers,57 // will use the same username/password which is undesirable.58 34 try { 59 35 HttpURLConnection.setFollowRedirects(true); 60 Authenticator.setDefault(authentication);61 36 } catch (SecurityException e) { 37 e.printStackTrace(); 62 38 } 63 }64 65 /**66 * The authentication class handling the login requests.67 */68 public static class OsmAuth extends Authenticator {69 /**70 * Set to true, when the autenticator tried the password once.71 */72 public boolean passwordtried = false;73 /**74 * Whether the user cancelled the password dialog75 */76 public boolean authCancelled = false;77 @Override protected PasswordAuthentication getPasswordAuthentication() {78 return credentialsManager.getPasswordAuthentication(this);79 }80 }81 82 /**83 * Must be called before each connection attemp to initialize the authentication.84 */85 protected final void initAuthentication() {86 authentication.authCancelled = false;87 authentication.passwordtried = false;88 }89 90 /**91 * @return Whether the connection was cancelled.92 */93 protected final boolean isAuthCancelled() {94 return authentication.authCancelled;95 39 } 96 40 … … 115 59 } 116 60 117 protected void addAuth(HttpURLConnection con) throws CharacterCodingException {61 protected void addAuth(HttpURLConnection con) throws OsmTransferException { 118 62 CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder(); 119 String auth; 63 CredentialsManagerResponse response; 64 String token; 120 65 try { 121 synchronized (credentialsManager) { 122 auth = credentialsManager.lookup(CredentialsManager.Key.USERNAME) + ":" + 123 credentialsManager.lookup(CredentialsManager.Key.PASSWORD); 66 synchronized (CredentialsManagerFactory.getCredentialManager()) { 67 response = CredentialsManagerFactory.getCredentialManager().getCredentials(RequestorType.SERVER, false /* don't know yet whether the credentials will succeed */); 124 68 } 125 } catch (CredentialsManager .CMException e) {126 auth = ":";69 } catch (CredentialsManagerException e) { 70 throw new OsmTransferException(e); 127 71 } 128 ByteBuffer bytes = encoder.encode(CharBuffer.wrap(auth)); 129 con.addRequestProperty("Authorization", "Basic "+Base64.encode(bytes)); 72 if (response == null) { 73 token = ":"; 74 } else if (response.isCanceled()) { 75 cancel = true; 76 return; 77 } else { 78 String username= response.getUsername() == null ? "" : response.getUsername(); 79 String password = response.getPassword() == null ? "" : String.valueOf(response.getPassword()); 80 token = username + ":" + password; 81 try { 82 ByteBuffer bytes = encoder.encode(CharBuffer.wrap(token)); 83 con.addRequestProperty("Authorization", "Basic "+Base64.encode(bytes)); 84 } catch(CharacterCodingException e) { 85 throw new OsmTransferException(e); 86 } 87 } 130 88 } 131 89 … … 139 97 return cancel; 140 98 } 141 /**142 * Default implementation of the CredentialsManager interface.143 * Saves passwords in plain text file.144 */145 public static class PlainCredentialsManager implements CredentialsManager {146 public String lookup(CredentialsManager.Key key) throws CMException {147 String secret = Main.pref.get("osm-server." + key.toString(), null);148 if (secret == null) throw new CredentialsManager.NoContentException();149 return secret;150 }151 public void store(CredentialsManager.Key key, String secret) {152 Main.pref.put("osm-server." + key.toString(), secret);153 }154 public PasswordAuthentication getPasswordAuthentication(OsmAuth caller) {155 String username, password;156 try {157 username = lookup(Key.USERNAME);158 } catch (CMException e) {159 username = "";160 }161 try {162 password = lookup(Key.PASSWORD);163 } catch (CMException e) {164 password = "";165 }166 if (caller.passwordtried || username.equals("") || password.equals("")) {167 JPanel p = new JPanel(new GridBagLayout());168 if (!username.equals("") && !password.equals("")) {169 p.add(new JLabel(tr("Incorrect password or username.")), GBC.eop());170 }171 p.add(new JLabel(tr("Username")), GBC.std().insets(0,0,10,0));172 JTextField usernameField = new JTextField(username, 20);173 p.add(usernameField, GBC.eol());174 p.add(new JLabel(tr("Password")), GBC.std().insets(0,0,10,0));175 JPasswordField passwordField = new JPasswordField(password, 20);176 p.add(passwordField, GBC.eol());177 JLabel warning = new JLabel(tr("Warning: The password is transferred unencrypted."));178 warning.setFont(warning.getFont().deriveFont(Font.ITALIC));179 p.add(warning, GBC.eop());180 181 JCheckBox savePassword = new JCheckBox(tr("Save user and password (unencrypted)"),182 !username.equals("") && !password.equals(""));183 p.add(savePassword, GBC.eop());184 185 ExtendedDialog dialog = new ExtendedDialog(186 Main.parent,187 tr("Enter Password"),188 new String[] {tr("Login"), tr("Cancel")}189 );190 dialog.setContent(p);191 dialog.setButtonIcons( new String[] {"ok.png", "cancel.png"});192 dialog.showDialog();193 194 if (dialog.getValue() != 1) {195 caller.authCancelled = true;196 return null;197 }198 username = usernameField.getText();199 password = String.valueOf(passwordField.getPassword());200 if (savePassword.isSelected()) {201 store(Key.USERNAME, username);202 store(Key.PASSWORD, password);203 }204 if (username.equals(""))205 return null;206 }207 caller.passwordtried = true;208 return new PasswordAuthentication(username, password.toCharArray());209 }210 public PreferenceAdditions newPreferenceAdditions() {211 return new PreferenceAdditions() {212 /**213 * Editfield for the Base url to the REST API from OSM.214 */215 final private JTextField osmDataServerURL = new JTextField(20);216 /**217 * Editfield for the username to the OSM account.218 */219 final private JTextField osmDataUsername = new JTextField(20);220 /**221 * Passwordfield for the userpassword of the REST API.222 */223 final private JPasswordField osmDataPassword = new JPasswordField(20);224 225 private String oldServerURL = "";226 private String oldUsername = "";227 private String oldPassword = "";228 229 public void addPreferenceOptions(JPanel panel) {230 try {231 oldServerURL = lookup(Key.OSM_SERVER_URL); // result is not null (see CredentialsManager)232 } catch (CMException e) {233 oldServerURL = "";234 }235 if (oldServerURL.equals("")) {236 oldServerURL = "http://api.openstreetmap.org/api";237 }238 try {239 oldUsername = lookup(Key.USERNAME);240 } catch (CMException e) {241 oldUsername = "";242 }243 try {244 oldPassword = lookup(Key.PASSWORD);245 } catch (CMException e) {246 oldPassword = "";247 }248 osmDataServerURL.setText(oldServerURL);249 osmDataUsername.setText(oldUsername);250 osmDataPassword.setText(oldPassword);251 osmDataServerURL.setToolTipText(tr("The base URL for the OSM server (REST API)"));252 osmDataUsername.setToolTipText(tr("Login name (e-mail) to the OSM account."));253 osmDataPassword.setToolTipText(tr("Login password to the OSM account. Leave blank to not store any password."));254 panel.add(new JLabel(tr("Base Server URL")), GBC.std());255 panel.add(osmDataServerURL, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));256 panel.add(new JLabel(tr("OSM username (e-mail)")), GBC.std());257 panel.add(osmDataUsername, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));258 panel.add(new JLabel(tr("OSM password")), GBC.std());259 panel.add(osmDataPassword, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,0));260 JLabel warning = new JLabel(tr("<html>" +261 "WARNING: The password is stored in plain text in the preferences file.<br>" +262 "The password is transferred in plain text to the server, encoded in the URL.<br>" +263 "<b>Do not use a valuable Password.</b></html>"));264 warning.setFont(warning.getFont().deriveFont(Font.ITALIC));265 panel.add(warning, GBC.eop().fill(GBC.HORIZONTAL));266 }267 public void preferencesChanged() {268 String newServerURL = osmDataServerURL.getText();269 String newUsername = osmDataUsername.getText();270 String newPassword = String.valueOf(osmDataPassword.getPassword());271 if (!oldServerURL.equals(newServerURL)) {272 store(Key.OSM_SERVER_URL, newServerURL);273 }274 if (!oldUsername.equals(newUsername)) {275 store(Key.USERNAME, newUsername);276 }277 if (!oldPassword.equals(newPassword)) {278 store(Key.PASSWORD, newPassword);279 }280 }281 };282 }283 }284 99 } -
trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
r2512 r2641 10 10 import java.net.MalformedURLException; 11 11 import java.net.URL; 12 import java. nio.charset.CharacterCodingException;12 import java.util.logging.Logger; 13 13 import java.util.zip.GZIPInputStream; 14 14 import java.util.zip.Inflater; … … 29 29 */ 30 30 public abstract class OsmServerReader extends OsmConnection { 31 31 static private final Logger logger = Logger.getLogger(OsmServerReader.class.getName()); 32 32 private OsmApi api = OsmApi.getOsmApi(); 33 33 private boolean doAuthenticate = false; … … 68 68 } 69 69 70 try { 71 if (doAuthenticate) { 72 addAuth(activeConnection); 73 } 74 } catch(CharacterCodingException e) { 75 System.err.println(tr("Error: failed to add authentication credentials to the connection.")); 76 throw new OsmTransferException(e); 70 if (doAuthenticate) { 71 addAuth(activeConnection); 77 72 } 73 if (cancel) 74 throw new OsmTransferCancelledException(); 78 75 if (Main.pref.getBoolean("osm-server.use-compression", true)) { 79 76 activeConnection.setRequestProperty("Accept-Encoding", "gzip, deflate"); … … 86 83 activeConnection.connect(); 87 84 } catch (Exception e) { 85 e.printStackTrace(); 88 86 throw new OsmTransferException(tr("Couldn't connect to the OSM server. Please check your internet connection."), e); 89 87 } 90 88 try { 91 if ( isAuthCancelled() &&activeConnection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED)89 if (activeConnection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED) 92 90 throw new OsmApiException(HttpURLConnection.HTTP_UNAUTHORIZED,null,null); 91 92 if (activeConnection.getResponseCode() == HttpURLConnection.HTTP_PROXY_AUTH) 93 throw new OsmTransferCancelledException(); 93 94 94 95 if (activeConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { -
trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java
r2628 r2641 1 1 // License: GPL. For details, see LICENSE file. 2 package org.openstreetmap.josm.io ;2 package org.openstreetmap.josm.io.auth; 3 3 4 import org.openstreetmap.josm.io.OsmConnection.OsmAuth; 4 import java.net.PasswordAuthentication; 5 import java.net.Authenticator.RequestorType; 5 6 6 7 /** 7 * Manages how username and password are stored. In addition all 8 * username/password-related user interaction is encapsulated here. 8 * A CredentialManager manages two credentials: 9 * <ul> 10 * <li>the credential for {@see RequestorType#SERVER} which is equal to the OSM API credentials 11 * in JOSM</li> 12 * <li>the credential for {@see RequestorType#PROXY} which is equal to the credentials for an 13 * optional HTTP proxy server a user may use</li> 14 * </ul> 9 15 */ 10 16 public interface CredentialsManager { 11 enum Key {12 OSM_SERVER_URL("url"),13 USERNAME("username"),14 PASSWORD("password");15 final private String pname;16 private Key(String name) {17 pname = name;18 }19 @Override public String toString() {20 return pname;21 }22 };23 17 24 18 /** 25 * Should throw or return non-null, possibly empty String. 19 * Looks up the credentials for a given type. 20 * 21 * @param the type of service. {@see RequestorType#SERVER} for the OSM API server, {@see RequestorType#PROXY} 22 * for a proxy server 23 * @return the credentials 24 * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface 26 25 */ 27 public String lookup(Key key) throws CMException;26 public PasswordAuthentication lookup(RequestorType requestorType) throws CredentialsManagerException; 28 27 29 28 /** 30 * May silently fail to store. 29 * Saves the credentials in <code>credentials</code> for the given service type. 30 * 31 * @param the type of service. {@see RequestorType#SERVER} for the OSM API server, {@see RequestorType#PROXY} 32 * for a proxy server 33 * @param credentials the credentials 34 * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface 31 35 */ 32 public void store( Key key, String secret) throws CMException;36 public void store(RequestorType requestorType, PasswordAuthentication credentials) throws CredentialsManagerException; 33 37 34 38 /** 35 * If authentication using the stored credentials fails, this method is 36 * called to promt for new username/password. 39 * 40 * @param requestorType the type of service. {@see RequestorType#SERVER} for the OSM API server, {@see RequestorType#PROXY} 41 * for a proxy server 42 * @param noSuccessWithLastResponse true, if the last request with the supplied credentials failed; false otherwise. 43 * If true, implementations of this interface are adviced prompt user for new credentials. 44 * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface 45 37 46 */ 38 public java.net.PasswordAuthentication getPasswordAuthentication(OsmAuth caller); 39 40 /** 41 * Credentials-related preference gui. 42 */ 43 public interface PreferenceAdditions { 44 public void addPreferenceOptions(javax.swing.JPanel panel); 45 public void preferencesChanged(); 46 } 47 public PreferenceAdditions newPreferenceAdditions(); 48 49 public class CMException extends Exception { 50 public CMException() {super();} 51 public CMException(String message, Throwable cause) {super(message, cause);} 52 public CMException(String message) {super(message);} 53 public CMException(Throwable cause) {super(cause);} 54 } 55 public class NoContentException extends CMException { 56 public NoContentException() {super();} 57 public NoContentException(String message, Throwable cause) {super(message, cause);} 58 public NoContentException(String message) {super(message);} 59 public NoContentException(Throwable cause) {super(cause);} 60 } 47 public CredentialsManagerResponse getCredentials(RequestorType requestorType, boolean noSuccessWithLastResponse) throws CredentialsManagerException; 61 48 } -
trunk/test/functional/org/openstreetmap/josm/io/UploadStrategySelectionPanelTest.java
r2600 r2641 55 55 } 56 56 57 public static void main(String args[]) throws OsmApiInitializationException 57 public static void main(String args[]) throws OsmApiInitializationException, OsmTransferCancelledException{ 58 58 JOSMFixture josmFixture = JOSMFixture.createFunctionalTestFixture(); 59 59 OsmApi.getOsmApi().initialize(NullProgressMonitor.INSTANCE);
Note:
See TracChangeset
for help on using the changeset viewer.