| | |
| | | import java.awt.event.WindowEvent;
|
| | | import java.io.File;
|
| | | import java.io.IOException;
|
| | | import java.net.ConnectException;
|
| | | import java.text.MessageFormat;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | |
| | | registrations.put(reg.name, reg);
|
| | | rebuildRecentMenu();
|
| | | } catch (Throwable t) {
|
| | | Utils.showException(GitblitManager.this, t);
|
| | | Throwable cause = t.getCause();
|
| | | if (cause instanceof ConnectException) {
|
| | | JOptionPane.showMessageDialog(GitblitManager.this, cause.getMessage(),
|
| | | Translation.get("gb.error"), JOptionPane.ERROR_MESSAGE);
|
| | | } else {
|
| | | Utils.showException(GitblitManager.this, t);
|
| | | }
|
| | | } finally {
|
| | | setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
| | | }
|
| | |
| | | Date lastLogin = dateFormat.parse(config.getString("servers", server, "lastLogin"));
|
| | | String url = config.getString("servers", server, "url");
|
| | | String account = config.getString("servers", server, "account");
|
| | | // FIXME this is pretty lame
|
| | | char[] password = new String(Base64.decode(config.getString("servers", server,
|
| | | "password"))).toCharArray();
|
| | | char[] password;
|
| | | String pw = config.getString("servers", server, "password");
|
| | | if (StringUtils.isEmpty(pw)) {
|
| | | password = new char[0];
|
| | | } else {
|
| | | // FIXME this is pretty lame
|
| | | password = new String(Base64.decode(pw)).toCharArray();
|
| | | }
|
| | | GitblitRegistration reg = new GitblitRegistration(server, url, account, password);
|
| | | reg.lastLogin = lastLogin;
|
| | | registrations.put(reg.name, reg);
|