Skip to content

Commit

Permalink
Merge pull request Azure#172 from WindowsAzure/dev
Browse files Browse the repository at this point in the history
Version 0.3.2 changes
  • Loading branch information
joostdenijs committed Oct 22, 2012
2 parents da5d538 + da4e764 commit 08c0b56
Show file tree
Hide file tree
Showing 20 changed files with 628 additions and 218 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.txt
@@ -1,3 +1,8 @@
2012.10.16 Version 0.3.2
* Implemented a more graceful timeout Exception
* Implemented a better Exception for an empty header returned by the Azure Storage Service
* Added Fluent setters for Blob Models

2012.09.11 Version 0.3.1
* Added Javadocs to 1.7 Storage Support from 0.3.0 release
* Fixed bug where getqueue for an invalid queue returns 200 and the exception is not wrapped in a ServiceException
Expand Down
2 changes: 1 addition & 1 deletion microsoft-azure-api/pom.xml
Expand Up @@ -17,7 +17,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.windowsazure</groupId>
<artifactId>microsoft-windowsazure-api</artifactId>
<version>0.3.1</version>
<version>0.3.2</version>
<packaging>jar</packaging>

<name>Microsoft Windows Azure Client API</name>
Expand Down
Expand Up @@ -976,8 +976,19 @@ else if (options.isUncommittedList()) {
ListBlobBlocksResult result = response.getEntity(ListBlobBlocksResult.class);
result.setEtag(response.getHeaders().getFirst("ETag"));
result.setContentType(response.getHeaders().getFirst("Content-Type"));
result.setContentLength(Long.parseLong(response.getHeaders().getFirst("x-ms-blob-content-length")));
result.setLastModified(dateMapper.parse(response.getHeaders().getFirst("Last-Modified")));

String blobContentLength = response.getHeaders().getFirst("x-ms-blob-content-length");
if (blobContentLength != null) {
result.setContentLength(Long.parseLong(blobContentLength));
}
else {
result.setContentLength(0);
}

String lastModified = response.getHeaders().getFirst("Last-Modified");
if (lastModified != null) {
result.setLastModified(dateMapper.parse(lastModified));
}

return result;
}
Expand Down
@@ -1,11 +1,11 @@
/**
* Copyright 2011 Microsoft Corporation
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -46,7 +46,7 @@ public class ContainerACL {
* Gets the <strong>Etag</strong> value associated with this {@link ContainerACL} instance. This is the value
* returned for a container by a Blob service REST API Get Container ACL operation, or the value to set on a
* container with a Set Container ACL operation.
*
*
* @return
* A {@link String} containing the <strong>Etag</strong> value associated with this {@link ContainerACL}
* instance.
Expand All @@ -61,20 +61,24 @@ public String getEtag() {
* This value is only set on a container when this {@link ContainerACL} instance is passed as a parameter to a call
* to an implementation of {@link BlobContract#setContainerACL(String, ContainerACL)} or
* {@link BlobContract#setContainerACL(String, ContainerACL, BlobServiceOptions)}.
*
*
* @param etag
* A {@link String} containing the <strong>Etag</strong> value to associate with this
* {@link ContainerACL} instance.
*
* @return
* A reference to this {@link ContainerACL} instance.
*/
public void setEtag(String etag) {
public ContainerACL setEtag(String etag) {
this.etag = etag;
return this;
}

/**
* Gets the last modified time associated with this {@link ContainerACL} instance. This is the value
* returned for a container by a Blob service REST API Get Container ACL operation, or the value to set on a
* container with a Set Container ACL operation.
*
*
* @return
* A {@link Date} containing the last modified time associated with this {@link ContainerACL} instance.
*/
Expand All @@ -88,19 +92,22 @@ public Date getLastModified() {
* This value is only set on a container when this {@link ContainerACL} instance is passed as a parameter to a call
* to an implementation of {@link BlobContract#setContainerACL(String, ContainerACL)} or
* {@link BlobContract#setContainerACL(String, ContainerACL, BlobServiceOptions)}.
*
*
* @param lastModified
* A {@link Date} containing the last modified time to associate with this {@link ContainerACL} instance.
* A {@link java.util.Date} containing the last modified time to associate with this {@link ContainerACL} instance.
* @return
* A reference to this {@link ContainerACL} instance.
*/
public void setLastModified(Date lastModified) {
public ContainerACL setLastModified(Date lastModified) {
this.lastModified = lastModified;
return this;
}

/**
* Gets the public access level associated with this {@link ContainerACL} instance. This is the value
* returned for a container by a Blob service REST API Get Container ACL operation, or the value to set on a
* container with a Set Container ACL operation.
*
*
* @return
* A {@link PublicAccessType} value representing the public access level associated with this
* {@link ContainerACL} instance.
Expand All @@ -115,20 +122,23 @@ public PublicAccessType getPublicAccess() {
* This value is only set on a container when this {@link ContainerACL} instance is passed as a parameter to a call
* to an implementation of {@link BlobContract#setContainerACL(String, ContainerACL)} or
* {@link BlobContract#setContainerACL(String, ContainerACL, BlobServiceOptions)}.
*
*
* @param publicAccess
* A {@link PublicAccessType} value representing the public access level to associate with this
* {@link ContainerACL} instance.
* @return
* A reference to this {@link ContainerACL} instance.
*/
public void setPublicAccess(PublicAccessType publicAccess) {
public ContainerACL setPublicAccess(PublicAccessType publicAccess) {
this.publicAccess = publicAccess;
return this;
}

/**
* Gets the list of container-level access policies associated with this {@link ContainerACL} instance. This is the
* value returned for a container by a Blob service REST API Get Container ACL operation, or the value to set on a
* container with a Set Container ACL operation.
*
*
* @return
* A {@link List} of {@link SignedIdentifier} instances containing up to five container-level access
* policies associated with this {@link ContainerACL} instance.
Expand All @@ -143,13 +153,16 @@ public List<SignedIdentifier> getSignedIdentifiers() {
* This value is only set on a container when this {@link ContainerACL} instance is passed as a parameter to a call
* to an implementation of {@link BlobContract#setContainerACL(String, ContainerACL)} or
* {@link BlobContract#setContainerACL(String, ContainerACL, BlobServiceOptions)}.
*
*
* @param signedIdentifiers
* A {@link List} of {@link SignedIdentifier} instances containing up to five container-level access
* policies to associate with this {@link ContainerACL} instance.
* @return
* A reference to this {@link ContainerACL} instance.
*/
public void setSignedIdentifiers(List<SignedIdentifier> signedIdentifiers) {
public ContainerACL setSignedIdentifiers(List<SignedIdentifier> signedIdentifiers) {
this.signedIdentifiers = signedIdentifiers;
return this;
}

/**
Expand All @@ -176,7 +189,7 @@ public void setSignedIdentifiers(List<SignedIdentifier> signedIdentifiers) {
* This value is only set on a container when this {@link ContainerACL} instance is passed as a parameter to a call
* to an implementation of {@link BlobContract#setContainerACL(String, ContainerACL)} or
* {@link BlobContract#setContainerACL(String, ContainerACL, BlobServiceOptions)}.
*
*
* @param id
* A {@link String} containing the name for the access policy.
* @param start
Expand Down Expand Up @@ -213,7 +226,7 @@ public static class SignedIdentifiers {

/**
* Gets the list of container-level access policies associated with this {@link SignedIdentifiers} instance.
*
*
* @return
* A {@link List} of {@link SignedIdentifier} instances containing container-level access policies.
*/
Expand All @@ -224,7 +237,7 @@ public List<SignedIdentifier> getSignedIdentifiers() {

/**
* Sets the list of container-level access policies associated with this {@link SignedIdentifiers} instance.
*
*
* @param signedIdentifiers
* A {@link List} of {@link SignedIdentifier} instances containing container-level access policies.
*/
Expand All @@ -243,7 +256,7 @@ public static class SignedIdentifier {
/**
* Gets the name of the container-level access policy. The name may be up to 64 characters in
* length and must be unique within the container.
*
*
* @return
* A {@link String} containing the name for the access policy.
*/
Expand All @@ -255,18 +268,21 @@ public String getId() {
/**
* Sets the name of the container-level access policy. The name may be up to 64 characters in
* length and must be unique within the container.
*
*
* @param id
* A {@link String} containing the name for the access policy.
* @return
* A reference to this {@link SignedIdentifier} instance.
*/
public void setId(String id) {
public SignedIdentifier setId(String id) {
this.id = id;
return this;
}

/**
* Gets an {@link AccessPolicy} reference containing the start time, expiration time, and permissions associated
* with the container-level access policy.
*
*
* @return
* An {@link AccessPolicy} reference containing the start time, expiration time, and permissions
* associated with the access policy.
Expand All @@ -279,13 +295,16 @@ public AccessPolicy getAccessPolicy() {
/**
* Sets an {@link AccessPolicy} reference containing the start time, expiration time, and permissions to
* associate with the container-level access policy.
*
*
* @param accessPolicy
* An {@link AccessPolicy} reference containing the start time, expiration time, and permissions
* to associate with the access policy.
* @return
* A reference to this {@link SignedIdentifier} instance.
*/
public void setAccessPolicy(AccessPolicy accessPolicy) {
public SignedIdentifier setAccessPolicy(AccessPolicy accessPolicy) {
this.accessPolicy = accessPolicy;
return this;
}
}

Expand All @@ -301,7 +320,7 @@ public static class AccessPolicy {
* Gets the start time for valid access to a resource using the access policy. If this value is
* <code>null</code>, the start time for any resource request using the access policy is assumed to be the time
* when the Blob service receives the request.
*
*
* @return
* A {@link Date} representing the start time for the access policy, or <code>null</code> if none is
* specified.
Expand All @@ -316,20 +335,23 @@ public Date getStart() {
* Sets the start time for valid access to a resource using the access policy. If this value is
* <code>null</code>, the start time for any resource request using the access policy is assumed to be the time
* when the Blob service receives the request.
*
*
* @param start
* A {@link Date} representing the start time for the access policy, or <code>null</code> to leave
* the time unspecified.
* @return
* A reference to this {@link AccessPolicy} instance.
*/
public void setStart(Date start) {
public AccessPolicy setStart(Date start) {
this.start = start;
return this;
}

/**
* Gets the expiration time for valid access to a resource using the access policy. If this value is
* <code>null</code>, any Shared Access Signature that refers to this access policy must specify the expiry
* value.
*
*
* @return
* A {@link Date} representing the expiration time for the access policy, or <code>null</code> if none
* is specified.
Expand All @@ -344,13 +366,16 @@ public Date getExpiry() {
* Sets the expiration time for valid access to a resource using the access policy. If this value is
* <code>null</code>, any Shared Access Signature that refers to this access policy must specify the expiry
* value.
*
*
* @param expiry
* A {@link Date} representing the expiration time for the access policy, or <code>null</code> to
* leave the time unspecified.
* @return
* A reference to this {@link AccessPolicy} instance.
*/
public void setExpiry(Date expiry) {
public AccessPolicy setExpiry(Date expiry) {
this.expiry = expiry;
return this;
}

/**
Expand All @@ -359,7 +384,7 @@ public void setExpiry(Date expiry) {
* operations to be performed with the access policy. For example, if all permissions to a resource are granted,
* the method returns "rwdl" as the result. If only read/write permissions are granted, the method returns "rw"
* as the result.
*
*
* @return
* A {@link String} containing the permissions specified for the access policy.
*/
Expand All @@ -373,12 +398,15 @@ public String getPermission() {
* include read (r), write (w), delete (d), and list (l). Permissions may be grouped so as to allow multiple
* operations to be performed with the access policy. For example, to grant all permissions to a resource,
* specify "rwdl" for the parameter. To grant only read/write permissions, specify "rw" for the parameter.
*
*
* @param permission
* A {@link String} containing the permissions specified for the access policy.
* @return
* A reference to this {@link AccessPolicy} instance.
*/
public void setPermission(String permission) {
public AccessPolicy setPermission(String permission) {
this.permission = permission;
return this;
}
}

Expand Down

0 comments on commit 08c0b56

Please sign in to comment.