public String value() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); }
@Override public String toString() { return value(); }
public static BlobType fromValue(String type) { try { return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } }
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof AzureBlob, "this binder is only valid for AzureBlobs!"); checkNotNull(request, "request"); AzureBlob blob = AzureBlob.class.cast(input); checkArgument(blob.getPayload().getContentMetadata().getContentLength() != null && blob.getPayload().getContentMetadata().getContentLength() >= 0, "size must be set"); Builder<String, String> headers = ImmutableMap.builder(); headers.put("x-ms-blob-type", blob.getProperties().getType().toString()); switch (blob.getProperties().getType()) { case PAGE_BLOB: headers.put(HttpHeaders.CONTENT_LENGTH, "0"); headers.put("x-ms-blob-content-length", blob.getPayload().getContentMetadata().getContentLength().toString()); break; case BLOCK_BLOB: checkArgument( checkNotNull(blob.getPayload().getContentMetadata().getContentLength(), "blob.getContentLength()") <= 64l * 1024 * 1024, "maximum size for put Blob is 64MB"); break; } request = (R) request.toBuilder().replaceHeaders(Multimaps.forMap(headers.build())).build(); return blobBinder.bindToRequest(request, azureBlob2Blob.apply(blob)); } }
nextMarker = (nextMarker.equals("")) ? null : nextMarker; } else if (qName.equals("BlobType")) { currentBlobType = BlobType.fromValue(currentText.toString().trim()); } else if (qName.equals("LeaseStatus")) { currentLeaseStatus = LeaseStatus.fromValue(currentText.toString().trim());
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof AzureBlob, "this binder is only valid for AzureBlobs!"); checkNotNull(request, "request"); AzureBlob blob = AzureBlob.class.cast(input); checkArgument(blob.getPayload().getContentMetadata().getContentLength() != null && blob.getPayload().getContentMetadata().getContentLength() >= 0, "size must be set"); Builder<String, String> headers = ImmutableMap.builder(); headers.put("x-ms-blob-type", blob.getProperties().getType().toString()); switch (blob.getProperties().getType()) { case PAGE_BLOB: headers.put(HttpHeaders.CONTENT_LENGTH, "0"); headers.put("x-ms-blob-content-length", blob.getPayload().getContentMetadata().getContentLength().toString()); break; case BLOCK_BLOB: checkArgument( checkNotNull(blob.getPayload().getContentMetadata().getContentLength(), "blob.getContentLength()") <= 64l * 1024 * 1024, "maximum size for put Blob is 64MB"); break; } request = (R) request.toBuilder().replaceHeaders(Multimaps.forMap(headers.build())).build(); return blobBinder.bindToRequest(request, azureBlob2Blob.apply(blob)); } }
nextMarker = (nextMarker.equals("")) ? null : nextMarker; } else if (qName.equals("BlobType")) { currentBlobType = BlobType.fromValue(currentText.toString().trim()); } else if (qName.equals("LeaseStatus")) { currentLeaseStatus = LeaseStatus.fromValue(currentText.toString().trim());
@Override public String toString() { return value(); }
public static BlobType fromValue(String type) { try { return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } }
public String value() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); }
@SuppressWarnings("unchecked") @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof AzureBlob, "this binder is only valid for AzureBlobs!"); checkNotNull(request, "request"); AzureBlob blob = AzureBlob.class.cast(input); checkArgument(blob.getPayload().getContentMetadata().getContentLength() != null && blob.getPayload().getContentMetadata().getContentLength() >= 0, "size must be set"); Builder<String, String> headers = ImmutableMap.builder(); headers.put("x-ms-blob-type", blob.getProperties().getType().toString()); switch (blob.getProperties().getType()) { case PAGE_BLOB: headers.put(HttpHeaders.CONTENT_LENGTH, "0"); headers.put("x-ms-blob-content-length", blob.getPayload().getContentMetadata().getContentLength().toString()); break; case BLOCK_BLOB: checkArgument( checkNotNull(blob.getPayload().getContentMetadata().getContentLength(), "blob.getContentLength()") <= 64l * 1024 * 1024, "maximum size for put Blob is 64MB"); break; } request = (R) request.toBuilder().replaceHeaders(Multimaps.forMap(headers.build())).build(); return blobBinder.bindToRequest(request, azureBlob2Blob.apply(blob)); } }
nextMarker = (nextMarker.equals("")) ? null : nextMarker; } else if (qName.equals("BlobType")) { currentBlobType = BlobType.fromValue(currentText.toString().trim()); } else if (qName.equals("LeaseStatus")) { currentLeaseStatus = LeaseStatus.fromValue(currentText.toString().trim());
@Override public String toString() { return value(); }
public static BlobType fromValue(String type) { try { return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } }
public String value() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); }
headers.put("x-ms-blob-type", blob.getProperties().getType().toString());
nextMarker = (nextMarker.equals("")) ? null : nextMarker; } else if (qName.equals("BlobType")) { currentBlobType = BlobType.fromValue(currentText.toString()); } else if (qName.equals("LeaseStatus")) { currentLeaseStatus = LeaseStatus.fromValue(currentText.toString());
@Override public String toString() { return value(); }
public static BlobType fromValue(String type) { try { return valueOf(CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(type, "type"))); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } }
public String value() { return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, name()); }