public void run() { wizardStepBackward(); log.error("File upload failed", e); ErrorDialog.showDialog(ownerFrame, null, uploaderProperties.getProperties(), "File upload failed", e); }; });
public void run() { ItemPropertiesDialog.showDialog(ownerFrame, getSelectedObjects(), cockpitLiteProperties.getProperties(), // Only admin users with all rights can view metadata (userCanUpload && userCanDownload && userCanACL && userCanDelete)); isViewingObjectProperties = false; } });
public void run() { ItemPropertiesDialog.showDialog(ownerFrame, getSelectedObjects(), cockpitLiteProperties.getProperties(), // Only admin users with all rights can view metadata (userCanUpload && userCanDownload && userCanACL && userCanDelete)); isViewingObjectProperties = false; } });
public void run() { wizardStepBackward(); log.error("File upload failed", e); ErrorDialog.showDialog(ownerFrame, null, uploaderProperties.getProperties(), "File upload failed", e); }; });
/** * Merges properties from another JetS3tProperties object into this instance. * If a new property already exists, the property value is replaced. * * @param properties * the object containing properties that will be merged into this set of properties. * @param propertiesSource * a name for the source of the properties, such as a properties file name or identifier. This * is only used to generate meaningful debug messages when properties are updated, so it is * possible to tell where the updated property value came from. */ public void loadAndReplaceProperties(Jets3tProperties properties, String propertiesSource) { Properties newProperties = properties.getProperties(); loadAndReplaceProperties(newProperties, propertiesSource); }
/** * Merges properties from another JetS3tProperties object into this instance. * If a new property already exists, the property value is replaced. * * @param properties * the object containing properties that will be merged into this set of properties. * @param propertiesSource * a name for the source of the properties, such as a properties file name or identifier. This * is only used to generate meaningful debug messages when properties are updated, so it is * possible to tell where the updated property value came from. */ public void loadAndReplaceProperties(Jets3tProperties properties, String propertiesSource) { Properties newProperties = properties.getProperties(); loadAndReplaceProperties(newProperties, propertiesSource); }
protected void startProgressPanel(Object operationId, String statusMessage, int maxCount, CancelEventTrigger cancelEventTrigger) { // Create new progress panel. final ProgressPanel progressPanel = new ProgressPanel( cockpitLiteProperties.getProperties(), cancelEventTrigger); progressPanel.startProgress(statusMessage, 0, maxCount); // Store this panel against the operation ID it tracks. progressPanelMap.put(operationId, progressPanel); // Display panel in progress notification area. SwingUtilities.invokeLater(new Runnable() { public void run() { progressNotificationPanel.add(progressPanel, new GridBagConstraints(0, progressNotificationPanel.getComponents().length, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); progressNotificationPanel.revalidate(); } }); }
protected void startProgressPanel(Object operationId, String statusMessage, int maxCount, CancelEventTrigger cancelEventTrigger) { // Create new progress panel. final ProgressPanel progressPanel = new ProgressPanel( cockpitLiteProperties.getProperties(), cancelEventTrigger); progressPanel.startProgress(statusMessage, 0, maxCount); // Store this panel against the operation ID it tracks. progressPanelMap.put(operationId, progressPanel); // Display panel in progress notification area. SwingUtilities.invokeLater(new Runnable() { public void run() { progressNotificationPanel.add(progressPanel, new GridBagConstraints(0, progressNotificationPanel.getComponents().length, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, insetsZero, 0, 0)); progressNotificationPanel.revalidate(); } }); }
@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();
@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_ACL_UPDATE, objectsToUpdate); if (signatureRequests != null) { String[] signedRequests = new String[signatureRequests.length]; for (int i = 0; i < signedRequests.length; i++) { signedRequests[i] = signatureRequests[i].getSignedUrl(); } s3ServiceMulti.putObjectsACLs(signedRequests, acl); } else { // Listing failed ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Sorry, you do not have the permission to change 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_DELETE, objects); if (signatureRequests != null) { String[] signedRequests = new String[signatureRequests.length]; for (int i = 0; i < signedRequests.length; i++) { signedRequests[i] = signatureRequests[i].getSignedUrl(); } s3ServiceMulti.deleteObjects(signedRequests); } else { ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Sorry, you do not have the permission to delete files", 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();
@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_ACL_UPDATE, objectsToUpdate); if (signatureRequests != null) { String[] signedRequests = new String[signatureRequests.length]; for (int i = 0; i < signedRequests.length; i++) { signedRequests[i] = signatureRequests[i].getSignedUrl(); } s3ServiceMulti.putObjectsACLs(signedRequests, acl); } else { // Listing failed ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Sorry, you do not have the permission to change 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_DELETE, objects); if (signatureRequests != null) { String[] signedRequests = new String[signatureRequests.length]; for (int i = 0; i < signedRequests.length; i++) { signedRequests[i] = signatureRequests[i].getSignedUrl(); } s3ServiceMulti.deleteObjects(signedRequests); } else { ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), "Sorry, you do not have the permission to delete files", 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();
@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();
String message = "Unable to update object list summary"; log.error(message, t); ErrorDialog.showDialog(ownerFrame, this, cockpitLiteProperties.getProperties(), message, t);
@Override public void run() { S3Object object = getSelectedObjects()[0]; String aclStatus = objectTableModel.getObjectAclStatus(object); boolean originalAclWasPublic = ACL_PUBLIC_DESCRIPTION.equals(aclStatus); ToggleAclDialog dialog = new ToggleAclDialog(ownerFrame, originalAclWasPublic, null, cockpitLiteProperties.getProperties()); dialog.setVisible(true); // Update ACL setting. S3Object minimalObject = new S3Object(object.getKey()); AccessControlList newAcl = (dialog.isPublicAclSet() ? AccessControlList.REST_CANNED_PUBLIC_READ : AccessControlList.REST_CANNED_PRIVATE); if (newAcl != null) { if (AccessControlList.REST_CANNED_PRIVATE.equals(newAcl)) { minimalObject.addMetadata(Constants.REST_HEADER_PREFIX + "acl", "private"); } else if (AccessControlList.REST_CANNED_PUBLIC_READ.equals(newAcl)) { minimalObject.addMetadata(Constants.REST_HEADER_PREFIX + "acl", "public-read"); } } updateObjectsAccessControlLists( new S3Object[] {minimalObject}, newAcl); dialog.dispose(); } }.start();
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) { new Thread() { @Override public void run() { prepareForFilesUpload((File[]) fileList.toArray(new File[fileList.size()])); } }.start(); } } catch (Exception e) { String message = "Unable to start accept dropped item(s)"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), 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) { new Thread() { @Override public void run() { prepareForFilesUpload((File[]) fileList.toArray(new File[fileList.size()])); } }.start(); } } catch (Exception e) { String message = "Unable to start accept dropped item(s)"; log.error(message, e); ErrorDialog.showDialog(ownerFrame, null, cockpitLiteProperties.getProperties(), message, e); } } else { dtde.rejectDrop(); } } };