/** * Puts an object inside an existing bucket, creating a new object or overwriting * an existing one with the same key. The Access Control List settings of the object * (if any) will also be applied. * <p> * This method can be performed by anonymous services. Anonymous services * can put objects into a publicly-writable bucket. * * @param bucketName * the name of the bucket inside which the object will be put. * @param object * the object containing all information that will be written to the service. * At very least this object must be valid. Beyond that it may contain: an input stream * with the object's data content, metadata, and access control settings. * <p> * <b>Note:</b> It is very important to set the object's Content-Length to match the size of the * data input stream when possible, as this can remove the need to read data into memory to * determine its size. * * @return * the object populated with any metadata. * @throws ServiceException */ public StorageObject putObject(String bucketName, StorageObject object) throws ServiceException { assertValidObject(object, "Create Object in bucket " + bucketName); MxDelegate.getInstance().registerStorageObjectPutEvent(bucketName, object.getKey()); return putObjectImpl(bucketName, object); }
/** * Puts an object inside an existing bucket, creating a new object or overwriting * an existing one with the same key. The Access Control List settings of the object * (if any) will also be applied. * <p> * This method can be performed by anonymous services. Anonymous services * can put objects into a publicly-writable bucket. * * @param bucketName * the name of the bucket inside which the object will be put. * @param object * the object containing all information that will be written to the service. * At very least this object must be valid. Beyond that it may contain: an input stream * with the object's data content, metadata, and access control settings. * <p> * <b>Note:</b> It is very important to set the object's Content-Length to match the size of the * data input stream when possible, as this can remove the need to read data into memory to * determine its size. * * @return * the object populated with any metadata. * @throws ServiceException */ public StorageObject putObject(String bucketName, StorageObject object) throws ServiceException { assertValidObject(object, "Create Object in bucket " + bucketName); MxDelegate.getInstance().registerStorageObjectPutEvent(bucketName, object.getKey()); return putObjectImpl(bucketName, object); }