String put()

in apis/openstack-swift/src/main/java/org/jclouds/openstack/swift/v1/features/ObjectApi.java [144:334]


   String put(@PathParam("objectName") String objectName, @BinderParam(SetPayload.class) Payload payload,
         PutOptions options);

   /**
    * Gets the {@link SwiftObject} metadata without its {@link Payload#openStream() body}.
    *
    * @param objectName
    *           corresponds to {@link SwiftObject#getName()}.
    *
    * @return the {@link SwiftObject} or {@code null}, if not found.
    */
   @Named("object:getWithoutBody")
   @HEAD
   @Path("/{objectName}")
   @ResponseParser(ParseObjectFromResponse.class)
   @Fallback(NullOnNotFoundOr404.class)
   @Nullable
   SwiftObject getWithoutBody(@PathParam("objectName") String objectName);

   /**
    * Gets the {@link SwiftObject} including its {@link Payload#openStream() body}.
    *
    * @param objectName
    *           corresponds to {@link SwiftObject#getName()}.
    *
    * @return the {@link SwiftObject} or {@code null}, if not found.
    */
   @Named("object:get")
   @GET
   @Path("/{objectName}")
   @ResponseParser(ParseObjectFromResponse.class)
   @Fallback(NullOnNotFoundOr404.class)
   @Nullable
   SwiftObject get(@PathParam("objectName") String objectName);

   /**
    * Gets the {@link SwiftObject} including its {@link Payload#openStream() body}.
    *
    * @param objectName
    *           corresponds to {@link SwiftObject#getName()}.
    * @param options
    *           options to control the download.
    *
    * @return the {@link SwiftObject} or {@code null}, if not found.
    */
   @Named("object:get")
   @GET
   @Path("/{objectName}")
   @ResponseParser(ParseObjectFromResponse.class)
   @Fallback(NullOnNotFoundOr404.class)
   @Nullable
   SwiftObject get(@PathParam("objectName") String objectName, GetOptions options);

   /**
    * Creates or updates the metadata for a {@link SwiftObject}.
    *
    * @param objectName
    *           corresponds to {@link SwiftObject#getName()}.
    * @param metadata
    *           the metadata to create or update.
    */
   @Named("object:updateMetadata")
   @POST
   @Path("/{objectName}")
   @Produces("")
   void updateMetadata(@PathParam("objectName") String objectName,
         @BinderParam(BindObjectMetadataToHeaders.class) Map<String, String> metadata);

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

   /**
    * Deletes the metadata from a {@link SwiftObject}.
    *
    * @param objectName
    *           corresponds to {@link SwiftObject#getName()}.
    * @param metadata
    *           corresponds to {@link SwiftObject#getMetadata()}.
    *
    * @return {@code true} if the metadata was successfully deleted,
    *         {@code false} if not.
    */
   @Named("object:deleteMetadata")
   @POST
   @Path("/{objectName}")
   @Fallback(FalseOnNotFoundOr404.class)
   boolean deleteMetadata(@PathParam("objectName") String objectName,
         @BinderParam(BindRemoveObjectMetadataToHeaders.class) Map<String, String> metadata);

   /**
    * Deletes an object, if present.
    *
    * @param objectName
    *           corresponds to {@link SwiftObject#getName()}.
    */
   @Named("object:delete")
   @DELETE
   @Path("/{objectName}")
   @Fallback(VoidOnNotFoundOr404.class)
   void delete(@PathParam("objectName") String objectName);

   /**
    * Copies an object from one container to another.
    *
    * <h3>NOTE</h3>
    * This is a server side copy.
    *
    * @param destinationObject
    *           the destination object name.
    * @param sourceContainer
    *           the source container name.
    * @param sourceObject
    *           the source object name.
    *
    * @deprecated call copy(String, String, String, CopyOptions) instead
    * @throws KeyNotFoundException if the source or destination container do not exist.
    */
   @Deprecated
   @Named("object:copy")
   @PUT
   @Path("/{destinationObject}")
   @Headers(keys = OBJECT_COPY_FROM, values = "/{sourceContainer}/{sourceObject}")
   void copy(@PathParam("destinationObject") String destinationObject,
                @PathParam("sourceContainer") String sourceContainer,
                @PathParam("sourceObject") String sourceObject);

   /**
    * Copies an object from one container to another.
    *
    * <h3>NOTE</h3>
    * This is a server side copy.
    *
    * @param destinationObject
    *           the destination object name.
    * @param sourceContainer
    *           the source container name.
    * @param sourceObject
    *           the source object name.
    * @param options
    *           conditional copy
    *
    * @throws KeyNotFoundException if the source or destination container do not exist.
    */
   @Named("object:copy")
   @PUT
   @Path("/{destinationObject}")
   @Headers(keys = OBJECT_COPY_FROM, values = "/{sourceContainer}/{sourceObject}")
   void copy(@PathParam("destinationObject") String destinationObject,
                @PathParam("sourceContainer") String sourceContainer,
                @PathParam("sourceObject") String sourceObject,
                CopyOptions options);

   /**
    * Copies an object from one container to another, replacing metadata.
    *
    * <h3>NOTE</h3>
    * This is a server side copy.
    *
    * @param destinationObject
    *           the destination object name.
    * @param sourceContainer
    *           the source container name.
    * @param sourceObject
    *           the source object name.
    * @param userMetadata
    *           Freeform metadata for the object, automatically prefixed/escaped
    * @param objectMetadata
    *           Unprefixed/unescaped metadata, such as Content-Disposition
    *
    * @deprecated call copy(String, String, String, Map, Map, CopyOptions) instead
    * @throws KeyNotFoundException if the source or destination container do not exist.
    */
   @Deprecated
   @Named("object:copy")
   @PUT
   @Path("/{destinationObject}")
   @Headers(keys = {OBJECT_COPY_FROM, OBJECT_COPY_FRESH_METADATA}, values = {"/{sourceContainer}/{sourceObject}", "True"})