@Override public Boolean preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_OK) { final BlobAttributes retrievedAttributes = BlobResponse.getBlobAttributes(this.getConnection(), blob.getStorageUri(), blob.snapshotID); blob.properties = retrievedAttributes.getProperties(); blob.metadata = retrievedAttributes.getMetadata(); return Boolean.valueOf(true); } else if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Boolean.valueOf(false); } else { this.setNonExceptionedRetryableFailure(true); // return false instead of null to avoid SCA issues return false; } } };
@Override public Boolean preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_OK) { // Set attributes final BlobContainerAttributes attributes = BlobResponse.getBlobContainerAttributes( this.getConnection(), client.isUsePathStyleUris()); container.metadata = attributes.getMetadata(); container.properties = attributes.getProperties(); container.name = attributes.getName(); return Boolean.valueOf(true); } else if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Boolean.valueOf(false); } else { this.setNonExceptionedRetryableFailure(true); // return false instead of null to avoid SCA issues return false; } } };
containerProperties.setEtag(BaseResponse.getEtag(request)); containerProperties.setLastModified(new Date(request.getLastModified())); containerAttributes.setMetadata(getMetadata(request)); containerProperties.setLeaseStatus(getLeaseStatus(request)); containerProperties.setLeaseState(getLeaseState(request)); containerProperties.setLeaseDuration(getLeaseDuration(request)); containerProperties.setPublicAccess(getPublicAccessLevel(request));
properties.setLastModified(lastModifiedCalendar.getTime()); properties.setLeaseStatus(getLeaseStatus(request)); properties.setLeaseState(getLeaseState(request)); properties.setLeaseDuration(getLeaseDuration(request)); properties.setCopyState(getCopyState(request)); attributes.setProperties(properties); return attributes;
@Override public String preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_CREATED) { this.setNonExceptionedRetryableFailure(true); return null; } container.updatePropertiesFromResponse(this.getConnection()); return BlobResponse.getLeaseID(this.getConnection()); }
@Override public Long preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return -1L; } container.updatePropertiesFromResponse(this.getConnection()); final String leaseTime = BlobResponse.getLeaseTime(this.getConnection()); return Utility.isNullOrEmpty(leaseTime) ? -1L : Long.parseLong(leaseTime); } };
@Override public BlobContainerPermissions preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { this.setNonExceptionedRetryableFailure(true); } container.updatePropertiesFromResponse(this.getConnection()); final String aclString = BlobResponse.getAcl(this.getConnection()); final BlobContainerPermissions containerAcl = getContainerAcl(aclString); container.properties.setPublicAccess(containerAcl.getPublicAccess()); return containerAcl; }
@Override public String preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return null; } blob.updateEtagAndLastModifiedFromResponse(this.getConnection()); blob.properties.setCopyState(BlobResponse.getCopyState(this.getConnection())); blob.properties.setPremiumPageBlobTier(premiumPageBlobTier); if (premiumPageBlobTier != null) { blob.properties.setBlobTierInferred(false); } return blob.properties.getCopyState().getCopyId(); } };
properties.setLastModified(lastModifiedCalendar.getTime()); properties.setLeaseStatus(getLeaseStatus(request)); properties.setLeaseState(getLeaseState(request)); properties.setLeaseDuration(getLeaseDuration(request)); properties.setCopyState(getCopyState(request)); attributes.setProperties(properties); return attributes;
@Override public String preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { this.setNonExceptionedRetryableFailure(true); return null; } updateEtagAndLastModifiedFromResponse(this.getConnection()); return BlobResponse.getLeaseID(this.getConnection()); } };
@Override public Long preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return -1L; } container.updatePropertiesFromResponse(this.getConnection()); final String leaseTime = BlobResponse.getLeaseTime(this.getConnection()); return Utility.isNullOrEmpty(leaseTime) ? -1L : Long.parseLong(leaseTime); } };
@Override public BlobContainerPermissions preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { this.setNonExceptionedRetryableFailure(true); } container.updatePropertiesFromResponse(this.getConnection()); final String aclString = BlobResponse.getAcl(this.getConnection()); final BlobContainerPermissions containerAcl = getContainerAcl(aclString); container.properties.setPublicAccess(containerAcl.getPublicAccess()); return containerAcl; }
@Override public String preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return null; } blob.updateEtagAndLastModifiedFromResponse(this.getConnection()); blob.properties.setCopyState(BlobResponse.getCopyState(this.getConnection())); blob.properties.setPremiumPageBlobTier(premiumPageBlobTier); if (premiumPageBlobTier != null) { blob.properties.setBlobTierInferred(false); } return blob.properties.getCopyState().getCopyId(); } };
containerProperties.setEtag(BaseResponse.getEtag(request)); containerProperties.setLastModified(new Date(request.getLastModified())); containerAttributes.setMetadata(getMetadata(request)); containerProperties.setLeaseStatus(getLeaseStatus(request)); containerProperties.setLeaseState(getLeaseState(request)); containerProperties.setLeaseDuration(getLeaseDuration(request)); containerProperties.setPublicAccess(getPublicAccessLevel(request));
@Override public String preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { this.setNonExceptionedRetryableFailure(true); return null; } container.updatePropertiesFromResponse(this.getConnection()); return BlobResponse.getLeaseID(this.getConnection()); } };
@Override public Boolean preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_OK) { final BlobAttributes retrievedAttributes = BlobResponse.getBlobAttributes(this.getConnection(), blob.getStorageUri(), blob.snapshotID); blob.properties = retrievedAttributes.getProperties(); blob.metadata = retrievedAttributes.getMetadata(); return Boolean.valueOf(true); } else if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Boolean.valueOf(false); } else { this.setNonExceptionedRetryableFailure(true); // return false instead of null to avoid SCA issues return false; } } };
@Override public Boolean preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_OK) { // Set attributes final BlobContainerAttributes attributes = BlobResponse.getBlobContainerAttributes( this.getConnection(), client.isUsePathStyleUris()); container.metadata = attributes.getMetadata(); container.properties = attributes.getProperties(); container.name = attributes.getName(); return Boolean.valueOf(true); } else if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Boolean.valueOf(false); } else { this.setNonExceptionedRetryableFailure(true); // return false instead of null to avoid SCA issues return false; } } };
@Override public Long preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return -1L; } updateEtagAndLastModifiedFromResponse(this.getConnection()); final String leaseTime = BlobResponse.getLeaseTime(this.getConnection()); blob.properties.setLeaseStatus(LeaseStatus.UNLOCKED); return Utility.isNullOrEmpty(leaseTime) ? -1L : Long.parseLong(leaseTime); } };
@Override public String preProcessResponse(CloudBlobContainer container, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_CREATED) { this.setNonExceptionedRetryableFailure(true); return null; } container.updatePropertiesFromResponse(this.getConnection()); return BlobResponse.getLeaseID(this.getConnection()); }
@Override public Void preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK) { this.setNonExceptionedRetryableFailure(true); return null; } // Set attributes final BlobAttributes retrievedAttributes = BlobResponse.getBlobAttributes(this.getConnection(), blob.getStorageUri(), blob.snapshotID); if (retrievedAttributes.getProperties().getBlobType() != blob.properties.getBlobType()) { throw new StorageException(StorageErrorCodeStrings.INCORRECT_BLOB_TYPE, String.format( SR.INVALID_BLOB_TYPE, blob.properties.getBlobType(), retrievedAttributes.getProperties() .getBlobType()), Constants.HeaderConstants.HTTP_UNUSED_306, null, null); } blob.properties = retrievedAttributes.getProperties(); blob.metadata = retrievedAttributes.getMetadata(); return null; } };