Interface ObjectApi


  • @Beta
    public interface ObjectApi
    Provides access to the OpenStack Object Storage (Swift) Object API features.

    This API is new to jclouds and hence is in Beta. That means we need people to use it and give us feedback. Based on that feedback, minor changes to the interfaces may happen. This code will replace org.jclouds.openstack.swift.SwiftClient in jclouds 2.0 and it is recommended you adopt it sooner than later.

    • Method Detail

      • updateMetadata

        @Named("object:updateMetadata")
        @POST
        @Path("/{objectName}")
        @Produces("")
        void updateMetadata​(@PathParam("objectName")
                            String objectName,
                            Map<String,​String> metadata)
        Creates or updates the metadata for a SwiftObject.
        Parameters:
        objectName - corresponds to SwiftObject.getName().
        metadata - the metadata to create or update.
      • updateHeaders

        @Named("object:updateMetadata")
        @POST
        @Path("/{objectName}")
        @Produces("")
        void updateHeaders​(@PathParam("objectName")
                           String objectName,
                           Map<String,​String> metadata)
        Creates or updates the metadata for a SwiftObject without escaping the key. This will also update metadata such as content-disposition.
        Parameters:
        objectName - corresponds to SwiftObject.getName().
        metadata - the metadata to create or update.
      • deleteMetadata

        @Named("object:deleteMetadata")
        @POST
        @Path("/{objectName}")
        boolean deleteMetadata​(@PathParam("objectName")
                               String objectName,
                               Map<String,​String> metadata)
        Deletes the metadata from a SwiftObject.
        Parameters:
        objectName - corresponds to SwiftObject.getName().
        metadata - corresponds to SwiftObject.getMetadata().
        Returns:
        true if the metadata was successfully deleted, false if not.
      • delete

        @Named("object:delete")
        @DELETE
        @Path("/{objectName}")
        void delete​(@PathParam("objectName")
                    String objectName)
        Deletes an object, if present.
        Parameters:
        objectName - corresponds to SwiftObject.getName().
      • copy

        @Deprecated
        @Named("object:copy")
        @PUT
        @Path("/{destinationObject}")
        void copy​(@PathParam("destinationObject")
                  String destinationObject,
                  @PathParam("sourceContainer")
                  String sourceContainer,
                  @PathParam("sourceObject")
                  String sourceObject)
        Deprecated.
        call copy(String, String, String, CopyOptions) instead
        Copies an object from one container to another.

        NOTE

        This is a server side copy.
        Parameters:
        destinationObject - the destination object name.
        sourceContainer - the source container name.
        sourceObject - the source object name.
        Throws:
        KeyNotFoundException - if the source or destination container do not exist.
      • copy

        @Named("object:copy")
        @PUT
        @Path("/{destinationObject}")
        void copy​(@PathParam("destinationObject")
                  String destinationObject,
                  @PathParam("sourceContainer")
                  String sourceContainer,
                  @PathParam("sourceObject")
                  String sourceObject,
                  CopyOptions options)
        Copies an object from one container to another.

        NOTE

        This is a server side copy.
        Parameters:
        destinationObject - the destination object name.
        sourceContainer - the source container name.
        sourceObject - the source object name.
        options - conditional copy
        Throws:
        KeyNotFoundException - if the source or destination container do not exist.
      • copy

        @Deprecated
        @Named("object:copy")
        @PUT
        @Path("/{destinationObject}")
        void copy​(@PathParam("destinationObject")
                  String destinationObject,
                  @PathParam("sourceContainer")
                  String sourceContainer,
                  @PathParam("sourceObject")
                  String sourceObject,
                  Map<String,​String> userMetadata,
                  Map<String,​String> objectMetadata)
        Deprecated.
        call copy(String, String, String, Map, Map, CopyOptions) instead
        Copies an object from one container to another, replacing metadata.

        NOTE

        This is a server side copy.
        Parameters:
        destinationObject - the destination object name.
        sourceContainer - the source container name.
        sourceObject - the source object name.
        userMetadata - Freeform metadata for the object, automatically prefixed/escaped
        objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
        Throws:
        KeyNotFoundException - if the source or destination container do not exist.
      • copy

        @Named("object:copy")
        @PUT
        @Path("/{destinationObject}")
        void copy​(@PathParam("destinationObject")
                  String destinationObject,
                  @PathParam("sourceContainer")
                  String sourceContainer,
                  @PathParam("sourceObject")
                  String sourceObject,
                  Map<String,​String> userMetadata,
                  Map<String,​String> objectMetadata,
                  CopyOptions options)
        Copies an object from one container to another, replacing metadata.

        NOTE

        This is a server side copy.
        Parameters:
        destinationObject - the destination object name.
        sourceContainer - the source container name.
        sourceObject - the source object name.
        userMetadata - Freeform metadata for the object, automatically prefixed/escaped
        objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
        options - conditional copy
        Throws:
        KeyNotFoundException - if the source or destination container do not exist.
      • copyAppendMetadata

        @Deprecated
        @Named("object:copy")
        @PUT
        @Path("/{destinationObject}")
        void copyAppendMetadata​(@PathParam("destinationObject")
                                String destinationObject,
                                @PathParam("sourceContainer")
                                String sourceContainer,
                                @PathParam("sourceObject")
                                String sourceObject,
                                Map<String,​String> userMetadata,
                                Map<String,​String> objectMetadata)
        Deprecated.
        call copyAppendMetadata(String, String, String, Map, Map, CopyOptions) instead
        Copies an object from one container to another, appending metadata.

        NOTE

        This is a server side copy.
        Parameters:
        destinationObject - the destination object name.
        sourceContainer - the source container name.
        sourceObject - the source object name.
        userMetadata - Freeform metadata for the object, automatically prefixed/escaped
        objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
        Throws:
        KeyNotFoundException - if the source or destination container do not exist.
      • copyAppendMetadata

        @Named("object:copy")
        @PUT
        @Path("/{destinationObject}")
        void copyAppendMetadata​(@PathParam("destinationObject")
                                String destinationObject,
                                @PathParam("sourceContainer")
                                String sourceContainer,
                                @PathParam("sourceObject")
                                String sourceObject,
                                Map<String,​String> userMetadata,
                                Map<String,​String> objectMetadata,
                                CopyOptions options)
        Copies an object from one container to another, appending metadata.

        NOTE

        This is a server side copy.
        Parameters:
        destinationObject - the destination object name.
        sourceContainer - the source container name.
        sourceObject - the source object name.
        userMetadata - Freeform metadata for the object, automatically prefixed/escaped
        objectMetadata - Unprefixed/unescaped metadata, such as Content-Disposition
        options - conditional copy
        Throws:
        KeyNotFoundException - if the source or destination container do not exist.