Skip to content

Commit

Permalink
Merge pull request Azure#176 from rpaquay/joe-merge-4
Browse files Browse the repository at this point in the history
Merged
  • Loading branch information
loudej committed Dec 3, 2011
2 parents f7ada16 + 08f88db commit 8bdef57
Show file tree
Hide file tree
Showing 13 changed files with 475 additions and 372 deletions.
Expand Up @@ -106,28 +106,28 @@ public Integer getConcurrentRequestCount() {
/**
* @return the disableContentMD5Validation
*/
protected Boolean getDisableContentMD5Validation() {
protected boolean getDisableContentMD5Validation() {
return this.disableContentMD5Validation;
}

/**
* @return the storeBlobContentMD5
*/
public Boolean getStoreBlobContentMD5() {
public boolean getStoreBlobContentMD5() {
return this.storeBlobContentMD5;
}

/**
* @return the useSparsePageBlob
*/
public Boolean getUseSparsePageBlob() {
public boolean getUseSparsePageBlob() {
return this.useSparsePageBlob;
}

/**
* @return the useTransactionalContentMD5
*/
public Boolean getUseTransactionalContentMD5() {
public boolean getUseTransactionalContentMD5() {
return this.useTransactionalContentMD5;
}

Expand All @@ -143,31 +143,31 @@ public void setConcurrentRequestCount(final Integer concurrentRequestCount) {
* @param disableContentMD5Validation
* the disableContentMD5Validation to set
*/
public void setDisableContentMD5Validation(final Boolean disableContentMD5Validation) {
public void setDisableContentMD5Validation(final boolean disableContentMD5Validation) {
this.disableContentMD5Validation = disableContentMD5Validation;
}

/**
* @param storeBlobContentMD5
* the storeBlobContentMD5 to set
*/
public void setStoreBlobContentMD5(final Boolean storeBlobContentMD5) {
public void setStoreBlobContentMD5(final boolean storeBlobContentMD5) {
this.storeBlobContentMD5 = storeBlobContentMD5;
}

/**
* @param useSparsePageBlob
* the useSparsePageBlob to set
*/
public void setUseSparsePageBlob(final Boolean useSparsePageBlob) {
public void setUseSparsePageBlob(final boolean useSparsePageBlob) {
this.useSparsePageBlob = useSparsePageBlob;
}

/**
* @param useTransactionalContentMD5
* the useTransactionalContentMD5 to set
*/
public void setUseTransactionalContentMD5(final Boolean useTransactionalContentMD5) {
public void setUseTransactionalContentMD5(final boolean useTransactionalContentMD5) {
this.useTransactionalContentMD5 = useTransactionalContentMD5;
}
}
Expand Up @@ -652,7 +652,7 @@ public Void execute(final CloudBlobClient client, final CloudBlob blob, final Op
*
*/
@DoesServiceRequest
public final Boolean deleteIfExists() throws StorageException {
public final boolean deleteIfExists() throws StorageException {
return this.deleteIfExists(DeleteSnapshotsOption.NONE, null, null, null);
}

Expand Down Expand Up @@ -684,7 +684,7 @@ public final Boolean deleteIfExists() throws StorageException {
* If a storage service error occurred.
*/
@DoesServiceRequest
public final Boolean deleteIfExists(final DeleteSnapshotsOption deleteSnapshotsOption,
public final boolean deleteIfExists(final DeleteSnapshotsOption deleteSnapshotsOption,
final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext)
throws StorageException {
Utility.assertNotNull("deleteSnapshotsOption", deleteSnapshotsOption);
Expand Down
Expand Up @@ -230,7 +230,6 @@ public Void execute(final CloudBlobClient client, final CloudBlobContainer conta
// Set attributes
final BlobContainerAttributes attributes = ContainerResponse.getAttributes(request,
client.isUsePathStyleUris());
container.setMetadata(attributes.getMetadata());
container.properties = attributes.getProperties();
container.name = attributes.getName();
return null;
Expand All @@ -250,7 +249,7 @@ public Void execute(final CloudBlobClient client, final CloudBlobContainer conta
* If a storage service error occurred.
*/
@DoesServiceRequest
public Boolean createIfNotExist() throws StorageException {
public boolean createIfNotExist() throws StorageException {
return this.createIfNotExist(null, null);
}

Expand All @@ -272,7 +271,7 @@ public Boolean createIfNotExist() throws StorageException {
* If a storage service error occurred.
*/
@DoesServiceRequest
public Boolean createIfNotExist(BlobRequestOptions options, OperationContext opContext) throws StorageException {
public boolean createIfNotExist(BlobRequestOptions options, OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
Expand Down Expand Up @@ -302,7 +301,6 @@ public Boolean execute(final CloudBlobClient client, final CloudBlobContainer co
// Set attributes
final BlobContainerAttributes attributes = ContainerResponse.getAttributes(request,
client.isUsePathStyleUris());
container.metadata = attributes.getMetadata();
container.properties = attributes.getProperties();
container.name = attributes.getName();
return true;
Expand Down Expand Up @@ -406,7 +404,7 @@ public Void execute(final CloudBlobClient client, final CloudBlobContainer conta
* If a storage service error occurred.
*/
@DoesServiceRequest
public Boolean deleteIfExists() throws StorageException {
public boolean deleteIfExists() throws StorageException {
return this.deleteIfExists(null, null);
}

Expand All @@ -428,7 +426,7 @@ public Boolean deleteIfExists() throws StorageException {
* If a storage service error occurred.
*/
@DoesServiceRequest
public Boolean deleteIfExists(BlobRequestOptions options, OperationContext opContext) throws StorageException {
public boolean deleteIfExists(BlobRequestOptions options, OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
Expand Down
Expand Up @@ -489,7 +489,7 @@ public CloudStorageAccount(final StorageCredentials storageCredentials, final UR
// won't ever really happen.

// Also eclipse's auto formatting below is horrible
public CloudStorageAccount(final StorageCredentialsAccountAndKey storageCredentials, final Boolean useHttps)
public CloudStorageAccount(final StorageCredentialsAccountAndKey storageCredentials, final boolean useHttps)
throws URISyntaxException {
this(storageCredentials, new URI(getDefaultBlobEndpoint(useHttps ? Constants.HTTPS : Constants.HTTP,
storageCredentials.getAccountName())), new URI(getDefaultQueueEndpoint(useHttps ? Constants.HTTPS
Expand Down Expand Up @@ -627,7 +627,7 @@ public String toString() {
* @param exportSecrets
* <code>true</code> to include sensitive data in the string; otherwise, <code>false</code>.
*/
public String toString(final Boolean exportSecrets) {
public String toString(final boolean exportSecrets) {
if (this.credentials != null && Utility.isNullOrEmpty(this.credentials.getAccountName())) {
return this.credentials.toString(exportSecrets);
}
Expand Down
Expand Up @@ -106,7 +106,7 @@ public static StorageCredentials tryParseCredentials(final String connectionStri
// signature string; otherwise, <Code>false</Code>
//
/** Reserved. */
public abstract Boolean canCredentialsComputeHmac();
public abstract boolean canCredentialsComputeHmac();

//
// RESERVED, for internal use only. Gets a value indicating whether a
Expand All @@ -117,7 +117,7 @@ public static StorageCredentials tryParseCredentials(final String connectionStri
// credentials; otherwise, <Code>false</Code>
//
/** Reserved. */
public abstract Boolean canCredentialsSignRequest();
public abstract boolean canCredentialsSignRequest();

//
// RESERVED, for internal use only. Gets a value indicating whether a
Expand All @@ -128,7 +128,7 @@ public static StorageCredentials tryParseCredentials(final String connectionStri
// credentials; otherwise, <code>false</code>
//
/** Reserved. */
public abstract Boolean canCredentialsSignRequestLite();
public abstract boolean canCredentialsSignRequestLite();

/**
* Computes a signature for the specified string using the HMAC-SHA256 algorithm.
Expand Down Expand Up @@ -202,7 +202,7 @@ public static StorageCredentials tryParseCredentials(final String connectionStri
// <Code>false</Code>
//
/** Reserved. */
public abstract Boolean doCredentialsNeedTransformUri();
public abstract boolean doCredentialsNeedTransformUri();

/**
* Returns the associated account name for the credentials.
Expand Down Expand Up @@ -291,7 +291,7 @@ public abstract void signRequestLite(HttpURLConnection request, long contentLeng
* <code>true</code> to include sensitive data in the return string; otherwise, <code>false</code>.
* @return A <code>String</code> that represents this object, optionally including sensitive data.
*/
public abstract String toString(Boolean exportSecrets);
public abstract String toString(boolean exportSecrets);

/**
* Transforms a resource URI into a shared access signature URI, by appending a shared access token.
Expand Down
Expand Up @@ -67,7 +67,7 @@ public StorageCredentialsAccountAndKey(final String accountName, final String ke
//
/** Reserved. */
@Override
public Boolean canCredentialsComputeHmac() {
public boolean canCredentialsComputeHmac() {
return true;
}

Expand All @@ -80,7 +80,7 @@ public Boolean canCredentialsComputeHmac() {
//
/** Reserved. */
@Override
public Boolean canCredentialsSignRequest() {
public boolean canCredentialsSignRequest() {
return true;
}

Expand All @@ -93,7 +93,7 @@ public Boolean canCredentialsSignRequest() {
//
/** Reserved. */
@Override
public Boolean canCredentialsSignRequestLite() {
public boolean canCredentialsSignRequestLite() {
return true;
}

Expand Down Expand Up @@ -181,7 +181,7 @@ public String computeHmac512(final String value, final OperationContext opContex
//
/** Reserved. */
@Override
public Boolean doCredentialsNeedTransformUri() {
public boolean doCredentialsNeedTransformUri() {
return false;
}

Expand Down Expand Up @@ -320,7 +320,7 @@ public void signRequestLite(final java.net.HttpURLConnection request, final long
* @return A <code>String</code> that represents this object, optionally including sensitive data.
*/
@Override
public String toString(final Boolean exportSecrets) {
public String toString(final boolean exportSecrets) {
return String.format("%s=%s;%s=%s", CloudStorageAccount.ACCOUNT_NAME_NAME, this.getAccountName(),
CloudStorageAccount.ACCOUNT_KEY_NAME, exportSecrets ? this.credentials.getKey().getBase64EncodedKey()
: "[key hidden]");
Expand Down
Expand Up @@ -52,7 +52,7 @@ protected StorageCredentialsAnonymous() {
//
/** Reserved. */
@Override
public Boolean canCredentialsComputeHmac() {
public boolean canCredentialsComputeHmac() {
return false;
}

Expand All @@ -65,7 +65,7 @@ public Boolean canCredentialsComputeHmac() {
//
/** Reserved. */
@Override
public Boolean canCredentialsSignRequest() {
public boolean canCredentialsSignRequest() {
return false;
}

Expand All @@ -78,7 +78,7 @@ public Boolean canCredentialsSignRequest() {
//
/** Reserved. */
@Override
public Boolean canCredentialsSignRequestLite() {
public boolean canCredentialsSignRequestLite() {
return false;
}

Expand Down Expand Up @@ -154,7 +154,7 @@ public String computeHmac512(final String value, final OperationContext opContex
//
/** Reserved. */
@Override
public Boolean doCredentialsNeedTransformUri() {
public boolean doCredentialsNeedTransformUri() {
return false;
}

Expand Down Expand Up @@ -238,7 +238,7 @@ public void signRequestLite(final java.net.HttpURLConnection request, final long
* @return a string representation of the credentials, optionally including sensitive data.
*/
@Override
public String toString(final Boolean exportSecrets) {
public String toString(final boolean exportSecrets) {
return Constants.EMPTY_STRING;
}

Expand Down
Expand Up @@ -49,7 +49,7 @@ public StorageCredentialsSharedAccessSignature(final String token) {
//
/** Reserved. */
@Override
public Boolean canCredentialsComputeHmac() {
public boolean canCredentialsComputeHmac() {
return false;
}

Expand All @@ -62,7 +62,7 @@ public Boolean canCredentialsComputeHmac() {
//
/** Reserved. */
@Override
public Boolean canCredentialsSignRequest() {
public boolean canCredentialsSignRequest() {
return false;
}

Expand All @@ -75,7 +75,7 @@ public Boolean canCredentialsSignRequest() {
//
/** Reserved. */
@Override
public Boolean canCredentialsSignRequestLite() {
public boolean canCredentialsSignRequestLite() {
return false;
}

Expand Down Expand Up @@ -157,7 +157,7 @@ public String computeHmac512(final String value, final OperationContext opContex
//
/** Reserved. */
@Override
public Boolean doCredentialsNeedTransformUri() {
public boolean doCredentialsNeedTransformUri() {
return true;
}

Expand Down Expand Up @@ -257,7 +257,7 @@ public void signRequestLite(final java.net.HttpURLConnection request, final long
* @return A <code>String</code> that represents this object, optionally including sensitive data.
*/
@Override
public String toString(final Boolean exportSecrets) {
public String toString(final boolean exportSecrets) {
return String.format("%s=%s", CloudStorageAccount.SHARED_ACCESS_SIGNATURE_NAME, exportSecrets ? this.token
: "[signature hidden]");
}
Expand Down
Expand Up @@ -283,7 +283,7 @@ else if (data.length % 3 == 2) {
* the string, as a <code>String</code> object, to validate
* @return <code>true</code> if <code>data</code> is a valid Base64 string, otherwise <code>false</code>
*/
public static Boolean validateIsBase64String(final String data) {
public static boolean validateIsBase64String(final String data) {

if (data == null || data.length() % 4 != 0) {
return false;
Expand Down
Expand Up @@ -146,10 +146,11 @@ public static <CLIENT_TYPE, PARENT_TYPE, RESULT_TYPE> RESULT_TYPE executeWithRet
setLastException(opContext, translatedException);
}
catch (final XMLStreamException e) {
// Retryable
// Non Retryable, just throw
translatedException = StorageException
.translateException(getLastRequestObject(opContext), e, opContext);
setLastException(opContext, translatedException);
throw translatedException;
}
catch (final InvalidKeyException e) {
// Non Retryable, just throw
Expand Down

0 comments on commit 8bdef57

Please sign in to comment.