* indirectly via the {@link #retrieveObjectsDetails} method. The <code>retrieveObjectsDetails</code>
* method retrieves all the details for the currently selected objects, and once they are available
* knows to display the dialog as the {@link #isViewingOrModifyingObjectProperties} flag is set.
*/
private void displayObjectsAttributesDialog() {
final S3Bucket selectedBucket = currentSelectedBucket;
runInBackgroundThread(new Runnable() {
public void run() {
if (!retrieveObjectsDetails(getSelectedObjects())) {
return;
}
if (objectsAttributesDialog == null) {
objectsAttributesDialog = new ObjectsAttributesDialog(
ownerFrame, "Object Attributes", skinsFactory);
}
final S3Object[] sourceObjects = getSelectedObjects();
boolean ok = runInDispatcherThreadImmediately(new Runnable() {
public void run() {
objectsAttributesDialog.displayDialog(sourceObjects, true);
}
});
if (!ok) {
return;
}
final String[] sourceObjectKeys = objectsAttributesDialog.getSourceObjectKeys();
final S3Object[] destinationObjects = objectsAttributesDialog.getDestinationObjects();
if (!objectsAttributesDialog.isModifyActionApproved()) {
// Do nothing.
return;
}
// Retain ACL settings from original objects.
if (!s3ServiceMulti.getObjectACLs(selectedBucket, sourceObjects)) {
return;
}
for (int i = 0; i < sourceObjects.length; i++) {
destinationObjects[i].setAcl(
sourceObjects[i].getAcl());
}
// Copy objects in-place, to REPLACE their metadata attributes.
ok = s3ServiceMulti.copyObjects(
selectedBucket.getName(), selectedBucket.getName(),
sourceObjectKeys, destinationObjects, true);
// Refresh details for modified objects
if (ok) {
s3ServiceMulti.getObjectsHeads(