/** * Shows the error dialog and waits for the user to acknowledge the dialog. * <p> * If the JetS3t property <tt>gui.verboseErrorDialog</tt> is set to true, this dialog will * display detailed information about the root cause of the error (the throwable, if provided) * </p> * * @param ownerFrame * the frame that will own the dialog * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. * @param message * a general error message, which should ideally be somewhat user-friendly. * @param throwable * the underlying exception that caused the error. */ public static void showDialog(Frame ownerFrame, HyperlinkActivatedListener hyperlinkListener, String message, Throwable throwable) { showDialog(ownerFrame, hyperlinkListener, null, message, throwable); }
/** * Shows the error dialog and waits for the user to acknowledge the dialog. * <p> * If the JetS3t property <tt>gui.verboseErrorDialog</tt> is set to true, this dialog will * display detailed information about the root cause of the error (the throwable, if provided) * </p> * * @param ownerDialog * the dialog that will own this dialog * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. * @param message * a general error message, which should ideally be somewhat user-friendly. * @param throwable * the underlying exception that caused the error. */ public static void showDialog(JDialog ownerDialog, HyperlinkActivatedListener hyperlinkListener, String message, Throwable throwable) { showDialog(ownerDialog, hyperlinkListener, null, message, throwable); }
/** * Shows the error dialog and waits for the user to acknowledge the dialog. * <p> * If the JetS3t property <tt>gui.verboseErrorDialog</tt> is set to true, this dialog will * display detailed information about the root cause of the error (the throwable, if provided) * </p> * * @param ownerFrame * the frame that will own the dialog * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. * @param message * a general error message, which should ideally be somewhat user-friendly. * @param throwable * the underlying exception that caused the error. */ public static void showDialog(Frame ownerFrame, HyperlinkActivatedListener hyperlinkListener, String message, Throwable throwable) { showDialog(ownerFrame, hyperlinkListener, null, message, throwable); }
/** * Shows the error dialog and waits for the user to acknowledge the dialog. * <p> * If the JetS3t property <tt>gui.verboseErrorDialog</tt> is set to true, this dialog will * display detailed information about the root cause of the error (the throwable, if provided) * </p> * * @param ownerDialog * the dialog that will own this dialog * @param hyperlinkListener * the listener that will act on any hyperlink events triggered by the user clicking on HTTP links. * @param message * a general error message, which should ideally be somewhat user-friendly. * @param throwable * the underlying exception that caused the error. */ public static void showDialog(JDialog ownerDialog, HyperlinkActivatedListener hyperlinkListener, String message, Throwable throwable) { showDialog(ownerDialog, hyperlinkListener, null, message, throwable); }
public void run() { wizardStepBackward(); log.error("File upload failed", e); ErrorDialog.showDialog(ownerFrame, null, uploaderProperties.getProperties(), "File upload failed", e); }; });
private boolean validPassphraseInputs(String passphrase, String password) { String invalidInputsMessage = ""; if (passphrase.length() < 6) { invalidInputsMessage += "Passphrase must be at least 6 characters."; } if (password.length() < 6) { invalidInputsMessage += (invalidInputsMessage.length() > 0 ? " and password" : "Password") + " must be at least 6 characters"; } if (invalidInputsMessage.length() > 0) { ErrorDialog.showDialog(this, hyperlinkListener, invalidInputsMessage, null); return false; } else { return true; } }
private boolean validPassphraseInputs(String passphrase, String password) { String invalidInputsMessage = ""; if (passphrase.length() < 6) { invalidInputsMessage += "Passphrase must be at least 6 characters."; } if (password.length() < 6) { invalidInputsMessage += (invalidInputsMessage.length() > 0 ? " and password" : "Password") + " must be at least 6 characters"; } if (invalidInputsMessage.length() > 0) { ErrorDialog.showDialog(this, hyperlinkListener, invalidInputsMessage, null); return false; } else { return true; } }
public void run() { wizardStepBackward(); log.error("File upload failed", e); ErrorDialog.showDialog(ownerFrame, null, uploaderProperties.getProperties(), "File upload failed", e); }; });
public void actionPerformed(ActionEvent e) { if (e.getSource().equals(okButton)) { String[] inputErrors = loginCredentialsPanel.checkForInputErrors(); if (inputErrors.length == 0) { isConfirmed = true; this.setVisible(false); } else { // Sanity-check provided information String errorMessages = "<html>Please correct the following errors:<ul>"; for (int i = 0; i < inputErrors.length; i++) { errorMessages += "<li>" + inputErrors[i] + "</li>"; } errorMessages += "</ul></html>"; ErrorDialog.showDialog(this, null, errorMessages, null); } } else if ("Cancel".equals(e.getActionCommand())) { isConfirmed = false; this.setVisible(false); } }
public void actionPerformed(ActionEvent e) { if (e.getSource().equals(okButton)) { String[] inputErrors = loginCredentialsPanel.checkForInputErrors(); if (inputErrors.length == 0) { isConfirmed = true; this.setVisible(false); } else { // Sanity-check provided information String errorMessages = "<html>Please correct the following errors:<ul>"; for (int i = 0; i < inputErrors.length; i++) { errorMessages += "<li>" + inputErrors[i] + "</li>"; } errorMessages += "</ul></html>"; ErrorDialog.showDialog(this, null, errorMessages, null); } } else if ("Cancel".equals(e.getActionCommand())) { isConfirmed = false; this.setVisible(false); } }
private void retrieveCredentialsFromDirectory(File directory, File credentialsFile, String password) { if (!validFolderInputs(false, directory, credentialsFile, password, true)) { return; } try { this.credentials = ProviderCredentials.load(password, credentialsFile); this.setVisible(false); } catch (Exception e) { String message = "<html><center>Unable to load your credentials from the file: " + credentialsFile + "<br><br>Please check your password</center></html>"; log.error(message, e); ErrorDialog.showDialog(this, hyperlinkListener, message, null); } }
@Override public void run() { try { SignatureRequest[] signatureRequests = requestSignedRequests( SignatureRequest.SIGNATURE_TYPE_ACL_LOOKUP, objects); if (signatureRequests != null) { String[] signedRequests = new String[signatureRequests.length]; for (int i = 0; i < signedRequests.length; i++) { signedRequests[i] = signatureRequests[i].getSignedUrl(); } s3ServiceMulti.getObjectsACLs(signedRequests); } else { // Signature request failed ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Sorry, you do not have the permission to view object privacy settings", null); } } catch (Exception e) { log.error("Gatekeeper permissions check failed", e); ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Permissions check failed, please try again", e); } } }).start();
@Override public void run() { try { SignatureRequest[] signatureRequests = requestSignedRequests( SignatureRequest.SIGNATURE_TYPE_HEAD, incompleteObjects); if (signatureRequests != null) { String[] signedRequests = new String[signatureRequests.length]; for (int i = 0; i < signedRequests.length; i++) { signedRequests[i] = signatureRequests[i].getSignedUrl(); } s3ServiceMulti.getObjectsHeads(signedRequests); } else { // Listing failed ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Sorry, you do not have the permission to view object details", null); } } catch (Exception e) { stopProgressDialog(); log.error("Gatekeeper permissions check failed", e); ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Permissions check failed, please try again", e); } }; }).start();
private void retrieveCredentialsFromDirectory(File directory, File credentialsFile, String password) { if (!validFolderInputs(false, directory, credentialsFile, password, true)) { return; } try { this.credentials = ProviderCredentials.load(password, credentialsFile); this.setVisible(false); } catch (Exception e) { String message = "<html><center>Unable to load your credentials from the file: " + credentialsFile + "<br><br>Please check your password</center></html>"; log.error(message, e); ErrorDialog.showDialog(this, hyperlinkListener, message, null); } }
public void run() { try { s3ServiceMulti.getS3Service().setRequesterPaysBucket( selectedBucket.getName(), newRequesterPaysFlag); selectedBucket.setRequesterPays(newRequesterPaysFlag); } catch (final Exception e) { String message = "Unable to update Requester Pays status"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, null, message, e); } } });
public void run() { try { s3ServiceMulti.getS3Service().setRequesterPaysBucket( selectedBucket.getName(), newRequesterPaysFlag); selectedBucket.setRequesterPays(newRequesterPaysFlag); } catch (final Exception e) { String message = "Unable to update Requester Pays status"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, null, message, e); } } });
public void drop(DropTargetDropEvent dtde) { if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor) && (DnDConstants.ACTION_COPY == dtde.getDropAction() || DnDConstants.ACTION_MOVE == dtde.getDropAction())) { dtde.acceptDrop(dtde.getDropAction()); try { final List fileList = (List) dtde.getTransferable().getTransferData( DataFlavor.javaFileListFlavor); if (fileList != null && fileList.size() > 0) { uploadFiles((File[]) fileList.toArray(new File[fileList.size()])); } } catch (Exception e) { String message = "Unable to start accept dropped items"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, null, message, e); } } else { dtde.rejectDrop(); } } };
public void drop(DropTargetDropEvent dtde) { if (dtde.isDataFlavorSupported(DataFlavor.javaFileListFlavor) && (DnDConstants.ACTION_COPY == dtde.getDropAction() || DnDConstants.ACTION_MOVE == dtde.getDropAction())) { dtde.acceptDrop(dtde.getDropAction()); try { final List fileList = (List) dtde.getTransferable().getTransferData( DataFlavor.javaFileListFlavor); if (fileList != null && fileList.size() > 0) { uploadFiles((File[]) fileList.toArray(new File[fileList.size()])); } } catch (Exception e) { String message = "Unable to start accept dropped items"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, null, message, e); } } else { dtde.rejectDrop(); } } };
/** * Updates the ACL settings for the currently selected bucket. */ private void updateBucketAccessControlList() { try { AccessControlList bucketACL = s3ServiceMulti.getS3Service().getBucketAcl(currentSelectedBucket); AccessControlList updatedBucketACL = AccessControlDialog.showDialog( ownerFrame, new S3Bucket[] {currentSelectedBucket}, bucketACL, this); if (updatedBucketACL != null) { currentSelectedBucket.setAcl(updatedBucketACL); s3ServiceMulti.getS3Service().putBucketAcl(currentSelectedBucket); } } catch (Exception e) { String message = "Unable to update bucket's Access Control List"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, this, message, e); } }
/** * Updates the ACL settings for the currently selected bucket. */ private void updateBucketAccessControlList() { try { AccessControlList bucketACL = s3ServiceMulti.getS3Service().getBucketAcl(currentSelectedBucket); AccessControlList updatedBucketACL = AccessControlDialog.showDialog( ownerFrame, new S3Bucket[] {currentSelectedBucket}, bucketACL, this); if (updatedBucketACL != null) { currentSelectedBucket.setAcl(updatedBucketACL); s3ServiceMulti.getS3Service().putBucketAcl(currentSelectedBucket); } } catch (Exception e) { String message = "Unable to update bucket's Access Control List"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, this, message, e); } }