def clear_data(self):
        """Removes the content data.

        raise:  NoAccess - ``Metadata.isRequired()`` is ``true`` or
                ``Metadata.isReadOnly()`` is ``true``
        *compliance: mandatory -- This method must be implemented.*

        """
        # cjshaw@mit.edu, Jan 9, 2015
        # Removes the item from AWS S3 and resets URL to ''
        odl_repo, url = get_aws_s3_handle(self._config_map)
        existing_url = self._payload.get_url_metadata().get_existing_string_values()[0]
        # try to clear from payload first, in case that fails we won't mess with AWS
        self._payload.clear_url()
        key_path = existing_url.replace(url, '')

        # for boto3, remove leading /
        if key_path[0] == '/':
            key_path = key_path[1::]
        odl_repo.delete_object(
            Bucket=self._config_map['s3_bucket'],
            Key=key_path
        )
def clear_data ( self ) : odl_repo , url = get_aws_s3_handle ( self . _config_map ) existing_url = self . _payload . get_url_metadata ( ) . get_existing_string_values ( ) [ 0 ] self . _payload . clear_url ( ) key_path = existing_url . replace ( url , '' ) if key_path [ 0 ] == '/' : key_path = key_path [ 1 : : ] odl_repo . delete_object ( Bucket = self . _config_map [ 's3_bucket' ] , Key = key_path )
Removes the content data.

        raise:  NoAccess - ``Metadata.isRequired()`` is ``true`` or
                ``Metadata.isReadOnly()`` is ``true``
        *compliance: mandatory -- This method must be implemented.*