/** * Deletes an object from a bucket. * <p> * This method can be performed by anonymous services. Anonymous services * can delete objects from publicly-writable buckets. * * @param bucketName * the name of the bucket containing the object to be deleted. * @param objectKey * the key representing the object * @throws ServiceException */ public void deleteObject(String bucketName, String objectKey) throws ServiceException { assertValidObject(objectKey, "deleteObject"); MxDelegate.getInstance().registerStorageObjectDeleteEvent(bucketName, objectKey); deleteObjectImpl(bucketName, objectKey, null, null, null); }
/** * Deletes an object from a bucket. * <p> * This method can be performed by anonymous services. Anonymous services * can delete objects from publicly-writable buckets. * * @param bucketName * the name of the bucket containing the object to be deleted. * @param objectKey * the key representing the object * @throws ServiceException */ public void deleteObject(String bucketName, String objectKey) throws ServiceException { assertValidObject(objectKey, "deleteObject"); MxDelegate.getInstance().registerStorageObjectDeleteEvent(bucketName, objectKey); deleteObjectImpl(bucketName, objectKey, null, null, null); }
/** * Applies access control settings to an object. The ACL settings must be included * with the object. * * This method can be performed by anonymous services, but can only succeed if the * object's existing ACL already allows write access by the anonymous user. * In general, you can only access the ACL of an object if the ACL already in place * for that object allows you to do so. * * @param bucketName * the name of the bucket containing the object to modify. * @param object * the object with ACL settings that will be applied. * @throws ServiceException */ public void putObjectAcl(String bucketName, StorageObject object) throws ServiceException { assertValidObject(object, "Put Object Access Control List"); putObjectAcl(bucketName, object.getKey(), object.getAcl()); }
/** * Applies access control settings to an object. The ACL settings must be included * with the object. * * This method can be performed by anonymous services, but can only succeed if the * object's existing ACL already allows write access by the anonymous user. * In general, you can only access the ACL of an object if the ACL already in place * for that object allows you to do so. * * @param bucketName * the name of the bucket containing the object to modify. * @param object * the object with ACL settings that will be applied. * @throws ServiceException */ public void putObjectAcl(String bucketName, StorageObject object) throws ServiceException { assertValidObject(object, "Put Object Access Control List"); putObjectAcl(bucketName, object.getKey(), object.getAcl()); }
/** * 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); }