/** * Creates stand-alone dialog box for testing only. * * @param args * @throws Exception */ public static void main(String args[]) throws Exception { JFrame f = new JFrame(); HyperlinkActivatedListener listener = new HyperlinkActivatedListener() { private static final long serialVersionUID = -225585129296632961L; public void followHyperlink(URL url, String target) { BareBonesBrowserLaunch.openURL(url.toString()); } }; StartupDialog startupDialog = new StartupDialog(f, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME), listener); startupDialog.setVisible(true); ProviderCredentials credentials = startupDialog.getProviderCredentials(); startupDialog.dispose(); if (credentials != null) { System.out.println("Credentials: " + credentials.getLogString()); } else { System.out.println("Credentials: null"); } f.dispose(); }
public void stateChanged(ChangeEvent e) { if (e.getSource().equals(tabbedPane)) { loginMode = tabbedPane.getSelectedIndex(); changedLoginMode(); } }
this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = -1742280851624947873L; this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(targetServicePanel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.getContentPane().add(tabbedPane, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); this.getContentPane().add(buttonsPanel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.pack(); this.setSize(500, 430); this.setLocationRelativeTo(this.getOwner());
private void storeCredentialsInStorageService(String passphrase, String password) { if (!validPassphraseInputs(passphrase, password)) { return; CredentialsDialog.showDialog(ownerFrame, (loginMode == LOGIN_MODE_LOCAL_FOLDER), this.isTargetS3(), myProperties, hyperlinkListener); if (credentials == null) { bucketName[0] = generateBucketNameFromPassphrase(passphrase); credentialObjectKey[0] = generateObjectKeyFromPassphrase(passphrase, password); } catch (Exception e) { String message = "Unable to generate bucket name or object key";
private void retrieveCredentialsFromStorageService(String passphrase, final String password) { if (!validPassphraseInputs(passphrase, password)) { return; bucketName[0] = generateBucketNameFromPassphrase(passphrase); credentialObjectKey[0] = generateObjectKeyFromPassphrase(passphrase, password); } catch (Exception e) { String message = "Unable to generate bucket name or object key";
StorageService service = getStorageService(); encryptedCredentialsObject = service.getObject( bucketName[0], credentialObjectKey[0]); myself.setVisible(false); } catch (ServiceException e) { SwingUtilities.invokeLater(new Runnable() {
StorageService service = getStorageService(); service.createBucket(bucketName[0]); service.putObject(bucketName[0], encryptedCredentialsObject);
this.setResizable(false); this.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); this.getRootPane().setDefaultButton(okButton); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW) .put(KeyStroke.getKeyStroke("ESCAPE"), "ESCAPE"); this.getRootPane().getActionMap().put("ESCAPE", new AbstractAction() { private static final long serialVersionUID = -1742280851624947873L; this.getContentPane().setLayout(new GridBagLayout()); this.getContentPane().add(targetServicePanel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.getContentPane().add(tabbedPane, new GridBagConstraints(0, row++, 2, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, insetsZero, 0, 0)); this.getContentPane().add(buttonsPanel, new GridBagConstraints(0, row++, 2, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsDefault, 0, 0)); this.pack(); this.setSize(500, 430); this.setLocationRelativeTo(this.getOwner());
private void storeCredentialsInStorageService(String passphrase, String password) { if (!validPassphraseInputs(passphrase, password)) { return; CredentialsDialog.showDialog(ownerFrame, (loginMode == LOGIN_MODE_LOCAL_FOLDER), this.isTargetS3(), myProperties, hyperlinkListener); if (credentials == null) { bucketName[0] = generateBucketNameFromPassphrase(passphrase); credentialObjectKey[0] = generateObjectKeyFromPassphrase(passphrase, password); } catch (Exception e) { String message = "Unable to generate bucket name or object key";
private void retrieveCredentialsFromStorageService(String passphrase, final String password) { if (!validPassphraseInputs(passphrase, password)) { return; bucketName[0] = generateBucketNameFromPassphrase(passphrase); credentialObjectKey[0] = generateObjectKeyFromPassphrase(passphrase, password); } catch (Exception e) { String message = "Unable to generate bucket name or object key";
StorageService service = getStorageService(); encryptedCredentialsObject = service.getObject( bucketName[0], credentialObjectKey[0]); myself.setVisible(false); } catch (ServiceException e) { SwingUtilities.invokeLater(new Runnable() {
StorageService service = getStorageService(); service.createBucket(bucketName[0]); service.putObject(bucketName[0], encryptedCredentialsObject);
/** * Creates stand-alone dialog box for testing only. * * @param args * @throws Exception */ public static void main(String args[]) throws Exception { JFrame f = new JFrame(); HyperlinkActivatedListener listener = new HyperlinkActivatedListener() { private static final long serialVersionUID = -225585129296632961L; public void followHyperlink(URL url, String target) { BareBonesBrowserLaunch.openURL(url.toString()); } }; StartupDialog startupDialog = new StartupDialog(f, Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME), listener); startupDialog.setVisible(true); ProviderCredentials credentials = startupDialog.getProviderCredentials(); startupDialog.dispose(); if (credentials != null) { System.out.println("Credentials: " + credentials.getLogString()); } else { System.out.println("Credentials: null"); } f.dispose(); }
public void stateChanged(ChangeEvent e) { if (e.getSource().equals(tabbedPane)) { loginMode = tabbedPane.getSelectedIndex(); changedLoginMode(); } }
try { if (credentials == null) { StartupDialog startupDialog = new StartupDialog(ownerFrame, cockpitProperties, this); startupDialog.setVisible(true); credentials = startupDialog.getProviderCredentials(); this.isTargetS3 = startupDialog.isTargetS3(); startupDialog.dispose();
try { if (credentials == null) { StartupDialog startupDialog = new StartupDialog(ownerFrame, cockpitProperties, this); startupDialog.setVisible(true); credentials = startupDialog.getProviderCredentials(); this.isTargetS3 = startupDialog.isTargetS3(); startupDialog.dispose();