/** * Returns an access condition such that an operation will be performed only if the resource exists on the service. * <p> * Setting this access condition modifies the request to include the HTTP <i>If-Match</i> conditional header. * <p> * For more information, see <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642'>Specifying Conditional Headers * for Blob Service Operations</a>. * * @return An <code>AccessCondition</code> object that represents the if exists condition. */ public static AccessCondition generateIfExistsCondition() { AccessCondition retCondition = new AccessCondition(); retCondition.setIfMatch("*"); return retCondition; }
/** * Returns an access condition such that an operation will be performed only if the resource exists on the service. * <p> * Setting this access condition modifies the request to include the HTTP <i>If-Match</i> conditional header. * <p> * For more information, see <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642'>Specifying Conditional Headers * for Blob Service Operations</a>. * * @return An <code>AccessCondition</code> object that represents the if exists condition. */ public static AccessCondition generateIfExistsCondition() { AccessCondition retCondition = new AccessCondition(); retCondition.setIfMatch("*"); return retCondition; }
/** * Returns an access condition such that an operation will be performed only if the resource's ETag value matches * the specified ETag value. * <p> * Setting this access condition modifies the request to include the HTTP <i>If-Match</i> conditional header. If * this access condition is set, the operation is performed only if the ETag of the resource matches the specified * ETag. * <p> * For more information, see <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642'>Specifying Conditional Headers * for Blob Service Operations</a>. * * @param etag * A <code>String</code> that represents the ETag value to check. * * @return An <code>AccessCondition</code> object that represents the <i>If-Match</i> condition. */ public static AccessCondition generateIfMatchCondition(final String etag) { AccessCondition retCondition = new AccessCondition(); retCondition.setIfMatch(etag); return retCondition; }
/** * Returns an access condition such that an operation will be performed only if the resource's ETag value matches * the specified ETag value. * <p> * Setting this access condition modifies the request to include the HTTP <i>If-Match</i> conditional header. If * this access condition is set, the operation is performed only if the ETag of the resource matches the specified * ETag. * <p> * For more information, see <a href= 'http://go.microsoft.com/fwlink/?LinkID=224642'>Specifying Conditional Headers * for Blob Service Operations</a>. * * @param etag * A <code>String</code> that represents the ETag value to check. * * @return An <code>AccessCondition</code> object that represents the <i>If-Match</i> condition. */ public static AccessCondition generateIfMatchCondition(final String etag) { AccessCondition retCondition = new AccessCondition(); retCondition.setIfMatch(etag); return retCondition; }
@Override public void recoveryAction(OperationContext context) throws IOException { if (this.getETagLockCondition() == null && (!Utility.isNullOrEmpty(this.getLockedETag()))) { AccessCondition etagLockCondition = new AccessCondition(); etagLockCondition.setIfMatch(this.getLockedETag()); if (accessCondition != null) { etagLockCondition.setLeaseID(accessCondition.getLeaseID()); } this.setETagLockCondition(etagLockCondition); } if (this.getCurrentRequestByteCount() > 0) { this.setOffset(startingOffset + this.getCurrentRequestByteCount()); if (length != null) { this.setLength(length - this.getCurrentRequestByteCount()); } } } };
@Override public void recoveryAction(OperationContext context) throws IOException { if (this.getETagLockCondition() == null && (!Utility.isNullOrEmpty(this.getLockedETag()))) { AccessCondition etagLockCondition = new AccessCondition(); etagLockCondition.setIfMatch(this.getLockedETag()); if (accessCondition != null) { etagLockCondition.setLeaseID(accessCondition.getLeaseID()); } this.setETagLockCondition(etagLockCondition); } if (this.getCurrentRequestByteCount() > 0) { this.setOffset(startingOffset + this.getCurrentRequestByteCount()); if (length != null) { this.setLength(length - this.getCurrentRequestByteCount()); } } } };
@Override public void recoveryAction(OperationContext context) throws IOException { if (this.getETagLockCondition() == null && (!Utility.isNullOrEmpty(this.getLockedETag()))) { AccessCondition etagLockCondition = new AccessCondition(); etagLockCondition.setIfMatch(this.getLockedETag()); if (accessCondition != null) { etagLockCondition.setLeaseID(accessCondition.getLeaseID()); } this.setETagLockCondition(etagLockCondition); } if (this.getCurrentRequestByteCount() > 0) { this.setOffset(startingOffset + this.getCurrentRequestByteCount()); if (lengthFinal != null) { this.setLength(lengthFinal - this.getCurrentRequestByteCount()); } } } };
@Override public void recoveryAction(OperationContext context) throws IOException { if (this.getETagLockCondition() == null && (!Utility.isNullOrEmpty(this.getLockedETag()))) { AccessCondition etagLockCondition = new AccessCondition(); etagLockCondition.setIfMatch(this.getLockedETag()); if (accessCondition != null) { etagLockCondition.setLeaseID(accessCondition.getLeaseID()); } this.setETagLockCondition(etagLockCondition); } if (this.getCurrentRequestByteCount() > 0) { this.setOffset(startingOffset + this.getCurrentRequestByteCount()); if (length != null) { this.setLength(length - this.getCurrentRequestByteCount()); } } } };