Class CopyObjectsDialog

    • Constructor Detail

      • CopyObjectsDialog

        public CopyObjectsDialog​(Frame owner,
                                 String title,
                                 SkinsFactory skinsFactory,
                                 org.jets3t.service.model.S3Object[] objects,
                                 org.jets3t.service.model.S3Bucket[] buckets)
        Construct a modal dialog for controlling copy opeations.
        Parameters:
        owner - the Frame over which the dialog will be displayed and centred.
        title - a title for the dialog.
        skinsFactory - factory for producing skinned GUI components.
        objects - the S3 objects that will be copied if the user confirms the dialog.
        buckets - a list of S3 buckets to which the user can copy objects.
    • Method Detail

      • renameObjectKeys

        protected Set renameObjectKeys​(org.jets3t.service.model.S3Object[] objects)
        Parameters:
        objects - the objects that will be renamed.
        Returns:
        the renamed keys that will result from the proposed renaming pattern.
      • renameObjectKey

        protected String renameObjectKey​(String key,
                                         int offset)
        Return the renamed key for an object based on the current renaming pattern. This method calculates values for the {key}, {count}, {path}, {filename}, {basename} and {ext} variables from the original key name, and returns the destination key name when these values are substituted into the current pattern.

        The substitution variables supported by this method are:

        • {key} - the original object key
        • {count} - an offset value for this object (one greater than the offset value provided to this method)
        • {path} - the path portion of the key name, up to the last occurence of a slash (/) character. If the key contains no slash characters, this variable will be an empty string.
        • {filename} - the filename portion of the key name, everything after the last slash (/) character. If the key contains no slash characters, this variable will be the original key name.
        • {ext} - the extension portion of a filename, if any.
        • {basename} - the file's base name, excluding the extension.
        Parameters:
        key - the original name of an S3 object.
        offset - the offset for the current object in a set of objects, eg this is the ith object in the list. This information is necessary to enable the {count}
        Returns:
        the renamed object key generated by the renaming pattern.
      • refreshNamesPreviewTable

        protected void refreshNamesPreviewTable()
        Refreshes the preview table to display the target keys that will be generated by the proposed renaming pattern.
      • isCopyActionApproved

        public boolean isCopyActionApproved()
        Returns:
        true if the user accepted the copy/move operation, false if the user cancelled the dialog.
      • isMoveOptionSelected

        public boolean isMoveOptionSelected()
        Returns:
        true if the user selected the Move option to indicate that objects should be moved, rather than merely copied.
      • isCopyOriginalAccessControlLists

        public boolean isCopyOriginalAccessControlLists()
        Returns:
        true if the use wishes to have the ACL settings of their source objects retained after the copy.
      • getSourceObjectKeys

        public String[] getSourceObjectKeys()
        Returns:
        the original key names of the S3 objects that should be copied or moved when this dialog is accepted.
      • getDestinationObjects

        public org.jets3t.service.model.S3Object[] getDestinationObjects()
        Returns:
        the objects that will be created as the destination of a copy or move operation. These objects include the metadata changes and Access Control List setting applied by the user.
      • getDestinationBucketName

        public String getDestinationBucketName()
        Returns:
        the name of the bucket to which objects should be copied or moved, as chosen by the user.