public final class AccessCondition extends Object
Constructor and Description |
---|
AccessCondition()
Creates an instance of the
AccessCondition class. |
Modifier and Type | Method and Description |
---|---|
void |
applyAppendConditionToRequest(HttpURLConnection request)
RESERVED FOR INTERNAL USE.
|
void |
applyConditionToRequest(HttpURLConnection request)
RESERVED FOR INTERNAL USE.
|
void |
applyLeaseConditionToRequest(HttpURLConnection request)
RESERVED FOR INTERNAL USE.
|
void |
applySequenceConditionToRequest(HttpURLConnection request)
RESERVED FOR INTERNAL USE.
|
void |
applySourceConditionToRequest(HttpURLConnection request)
RESERVED FOR INTERNAL USE.
|
static AccessCondition |
generateEmptyCondition()
Generates a new empty AccessCondition.
|
static AccessCondition |
generateIfExistsCondition()
Returns an access condition such that an operation will be performed only if the resource exists on the service.
|
static AccessCondition |
generateIfMatchCondition(String etag)
Returns an access condition such that an operation will be performed only if the resource's ETag value matches
the specified ETag value.
|
static AccessCondition |
generateIfModifiedSinceCondition(Date lastMotified)
Returns an access condition such that an operation will be performed only if the resource has been modified since
the specified time.
|
static AccessCondition |
generateIfNoneMatchCondition(String etag)
Returns an access condition such that an operation will be performed only if the resource's ETag value does not
match the specified ETag value.
|
static AccessCondition |
generateIfNotExistsCondition()
Returns an access condition such that an operation will be performed only if the resource does not exist on the
service.
|
static AccessCondition |
generateIfNotModifiedSinceCondition(Date lastMotified)
Returns an access condition such that an operation will be performed only if the resource has not been modified
since the specified time.
|
static AccessCondition |
generateIfSequenceNumberEqualCondition(long sequenceNumber)
Returns an access condition such that an operation will be performed only if resource's current sequence
number is equal to the specified value.
|
static AccessCondition |
generateIfSequenceNumberLessThanCondition(long sequenceNumber)
Returns an access condition such that an operation will be performed only if resource's current sequence
number is less than the specified value.
|
static AccessCondition |
generateIfSequenceNumberLessThanOrEqualCondition(long sequenceNumber)
Returns an access condition such that an operation will be performed only if resource's current sequence
number is less than or equal to the specified value.
|
static AccessCondition |
generateLeaseCondition(String leaseID)
Returns an access condition such that an operation will be performed only if the resource is accessible under the
specified lease ID.
|
Long |
getIfAppendPositionEqual()
Gets the value for a conditional header used only for append operations.
|
String |
getIfMatch()
Gets the ETag when the If-Match condition is set.
|
Long |
getIfMaxSizeLessThanOrEqual()
Gets the value for a conditional header used only for append operations.
|
Date |
getIfModifiedSinceDate()
Gets the If-Modified-Since date.
|
String |
getIfNoneMatch()
Gets the ETag when the If-None-Match condition is set.
|
Long |
getIfSequenceNumberEqual()
Gets the sequence number when the sequence number equal condition is set.
|
Long |
getIfSequenceNumberLessThan()
Gets the sequence number when the sequence number less than condition is set.
|
Long |
getIfSequenceNumberLessThanOrEqual()
Gets the sequence number when the sequence number less than or equal condition is set.
|
Date |
getIfUnmodifiedSinceDate()
Gets the If-Unmodified-Since date.
|
String |
getLeaseID()
Gets the lease ID.
|
void |
setIfAppendPositionEqual(Long ifAppendPositionEqual)
Sets the value for a conditional header used only for append operations.
|
void |
setIfMatch(String etag)
Sets the ETag for the If-Match condition.
|
void |
setIfMaxSizeLessThanOrEqual(Long ifMaxSizeLessThanOrEqual)
Sets the value for a conditional header used only for append operations.
|
void |
setIfModifiedSinceDate(Date ifModifiedSinceDate)
Sets the If-Modified-Since date.
|
void |
setIfNoneMatch(String etag)
Sets the ETag for the If-None-Match condition.
|
void |
setIfSequenceNumberEqual(Long sequenceNumber)
Sets the sequence number for the sequence number equal to condition.
|
void |
setIfSequenceNumberLessThan(Long sequenceNumber)
Sets the sequence number for the sequence number less than condition.
|
void |
setIfSequenceNumberLessThanOrEqual(Long sequenceNumber)
Sets the sequence number for the sequence number less than or equal to condition.
|
void |
setIfUnmodifiedSinceDate(Date ifUnmodifiedSinceDate)
Sets the If-Unmodified-Since date.
|
void |
setLeaseID(String leaseID)
Gets the lease ID.
|
boolean |
verifyConditional(String etag,
Date lastModified)
RESERVED FOR INTERNAL USE.
|
public AccessCondition()
AccessCondition
class.public static AccessCondition generateEmptyCondition()
For more information, see Specifying Conditional Headers for Blob Service Operations.
AccessCondition
object that has no conditions set.public static AccessCondition generateIfMatchCondition(String etag)
Setting this access condition modifies the request to include the HTTP If-Match conditional header. If this access condition is set, the operation is performed only if the ETag of the resource matches the specified ETag.
For more information, see Specifying Conditional Headers for Blob Service Operations.
etag
- A String
that represents the ETag value to check.AccessCondition
object that represents the If-Match condition.public static AccessCondition generateIfModifiedSinceCondition(Date lastMotified)
Setting this access condition modifies the request to include the HTTP If-Modified-Since conditional header. If this access condition is set, the operation is performed only if the resource has been modified since the specified time.
For more information, see Specifying Conditional Headers for Blob Service Operations.
lastMotified
- A java.util.Date
object that represents the last-modified time to check for the resource.AccessCondition
object that represents the If-Modified-Since condition.public static AccessCondition generateIfNoneMatchCondition(String etag)
Setting this access condition modifies the request to include the HTTP If-None-Match conditional header. If this access condition is set, the operation is performed only if the ETag of the resource does not match the specified ETag.
For more information, see Specifying Conditional Headers for Blob Service Operations.
etag
- A String
that represents the ETag value to check.AccessCondition
object that represents the If-None-Match condition.public static AccessCondition generateIfNotModifiedSinceCondition(Date lastMotified)
Setting this access condition modifies the request to include the HTTP If-Unmodified-Since conditional header. If this access condition is set, the operation is performed only if the resource has not been modified since the specified time.
For more information, see Specifying Conditional Headers for Blob Service Operations.
lastMotified
- A java.util.Date
object that represents the last-modified time to check for the resource.AccessCondition
object that represents the If-Unmodified-Since condition.public static AccessCondition generateIfSequenceNumberLessThanOrEqualCondition(long sequenceNumber)
sequenceNumber
- The value to compare to the current sequence number.AccessCondition
object that represents the If-Sequence-Number-LE condition.public static AccessCondition generateIfSequenceNumberLessThanCondition(long sequenceNumber)
sequenceNumber
- The value to compare to the current sequence number.AccessCondition
object that represents the If-Sequence-Number-LT condition.public static AccessCondition generateIfSequenceNumberEqualCondition(long sequenceNumber)
sequenceNumber
- The value to compare to the current sequence number.AccessCondition
object that represents the If-Sequence-Number-EQ condition.public static AccessCondition generateLeaseCondition(String leaseID)
For more information, see Specifying Conditional Headers for Blob Service Operations.
leaseID
- The lease ID to specify.AccessCondition
object that represents the lease condition.public static AccessCondition generateIfExistsCondition()
Setting this access condition modifies the request to include the HTTP If-Match conditional header.
For more information, see Specifying Conditional Headers for Blob Service Operations.
AccessCondition
object that represents the if exists condition.public static AccessCondition generateIfNotExistsCondition()
Setting this access condition modifies the request to include the HTTP If-None-Match conditional header.
For more information, see Specifying Conditional Headers for Blob Service Operations.
AccessCondition
object that represents the if not exists condition.public void applyConditionToRequest(HttpURLConnection request)
request
- A java.net.HttpURLConnection
object that represents the request
to which the condition is being applied.public void applySourceConditionToRequest(HttpURLConnection request)
request
- A java.net.HttpURLConnection
object that represents the request
to which the condition is being applied.public void applyAppendConditionToRequest(HttpURLConnection request)
request
- A java.net.HttpURLConnection
object that represents the request to which the condition is
being applied.StorageException
- If there is an error parsing the date value of the access condition.public void applyLeaseConditionToRequest(HttpURLConnection request)
request
- A java.net.HttpURLConnection
object that represents the request
to which the condition is being applied.public void applySequenceConditionToRequest(HttpURLConnection request)
request
- A java.net.HttpURLConnection
object that represents the request
to which the condition is being applied.public Long getIfAppendPositionEqual()
null
if no condition exists.public String getIfMatch()
public Long getIfMaxSizeLessThanOrEqual()
null
if no condition exists.public Date getIfModifiedSinceDate()
java.util.Date
object that represents the If-Modified-Since date.public String getIfNoneMatch()
public Date getIfUnmodifiedSinceDate()
java.util.Date
object that represents the If-Unmodified-Since date.public String getLeaseID()
public Long getIfSequenceNumberLessThanOrEqual()
null
public Long getIfSequenceNumberLessThan()
null
public Long getIfSequenceNumberEqual()
null
public void setIfAppendPositionEqual(Long ifAppendPositionEqual)
ifAppendPositionEqual
- The append position number, or null
if no condition exists.public void setIfMatch(String etag)
etag
- The ETag to set for the If-Match condition.public void setIfMaxSizeLessThanOrEqual(Long ifMaxSizeLessThanOrEqual)
ifMaxSizeLessThanOrEqual
- The maximum size, or null
if no condition exists.public void setIfModifiedSinceDate(Date ifModifiedSinceDate)
ifModifiedSinceDate
- A java.util.Date
object that represents the If-Modified-Since to set.public void setIfNoneMatch(String etag)
etag
- The ETag to set for the If-None-Match condition.public void setIfUnmodifiedSinceDate(Date ifUnmodifiedSinceDate)
ifUnmodifiedSinceDate
- A java.util.Date
object that represents the If-Unmodified-Since to set.public void setLeaseID(String leaseID)
leaseID
- The lease ID to set.public void setIfSequenceNumberLessThanOrEqual(Long sequenceNumber)
sequenceNumber
- The sequence number to set the if sequence number less than or equal condition to.public void setIfSequenceNumberLessThan(Long sequenceNumber)
sequenceNumber
- The sequence number to set the if sequence number less than condition to.public void setIfSequenceNumberEqual(Long sequenceNumber)
sequenceNumber
- The sequence number to set the if sequence number equal condition to.public boolean verifyConditional(String etag, Date lastModified)
etag
- A String
that represents the ETag to check.lastModified
- A java.util.Date
object that represents the last modified date/time.true
if the condition is satisfied; otherwise, false
.Copyright © 2019. All rights reserved.