HttpHeaders.IF_UNMODIFIED_SINCE); String eTag = metadata.getETag(); if (eTag != null) { eTag = maybeQuoteETag(eTag);
response.setContentType(overrideContentType != null ? overrideContentType : contentMetadata.getContentType()); String eTag = metadata.getETag(); if (eTag != null) { response.addHeader(HttpHeaders.ETAG, maybeQuoteETag(eTag));
public MutableBlobProperties apply(BlobMetadata from) { if (from == null) return null; MutableBlobProperties to = new MutableBlobPropertiesImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setName(from.getName()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableObjectMetadata apply(BlobMetadata from) { if (from == null) return null; MutableObjectMetadata to = new MutableObjectMetadataImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setKey(from.getName()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; } }
public MutableBlobProperties apply(BlobMetadata from) { if (from == null) return null; MutableBlobProperties to = new MutableBlobPropertiesImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setName(from.getName()); to.setUrl(from.getUri()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableBlobProperties apply(BlobMetadata from) { if (from == null) return null; MutableBlobProperties to = new MutableBlobPropertiesImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setName(from.getName()); to.setUrl(from.getUri()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableBlobProperties apply(BlobMetadata from) { if (from == null) return null; MutableBlobProperties to = new MutableBlobPropertiesImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setName(from.getName()); to.setUrl(from.getUri()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableBlobProperties apply(BlobMetadata from) { if (from == null) return null; MutableBlobProperties to = new MutableBlobPropertiesImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setName(from.getName()); to.setUrl(from.getUri()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableObjectMetadata apply(BlobMetadata from) { if (from == null) return null; MutableObjectMetadata to = new MutableObjectMetadataImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setUri(from.getUri()); to.setETag(from.getETag()); to.setKey(from.getName()); to.setBucket(bucket); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableBlobProperties apply(BlobMetadata from) { if (from == null) return null; MutableBlobProperties to = new MutableBlobPropertiesImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setETag(from.getETag()); to.setName(from.getName()); to.setUrl(from.getUri()); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableObjectMetadata apply(BlobMetadata from) { if (from == null) return null; MutableObjectMetadata to = new MutableObjectMetadataImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setUri(from.getUri()); to.setETag(from.getETag()); to.setKey(from.getName()); to.setBucket(bucket); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public MutableObjectMetadata apply(BlobMetadata from) { if (from == null) return null; MutableObjectMetadata to = new MutableObjectMetadataImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setUri(from.getUri()); to.setETag(from.getETag()); to.setKey(from.getName()); to.setBucket(bucket); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } return to; }
public StorageMetadata apply(BlobMetadata input) { if (input.getContentMetadata().getContentType().equals("application/directory")) { return new StorageMetadataImpl(StorageType.RELATIVE_PATH, input.getProviderId(), input .getName(), input.getLocation(), input.getUri(), input.getETag(), input.getCreationDate(), input.getLastModified(), input.getUserMetadata()); } return input; } }), from.getNextMarker());
public StorageMetadata apply(BlobMetadata input) { if (input.getContentMetadata().getContentType().equals("application/directory")) { return new StorageMetadataImpl(StorageType.RELATIVE_PATH, input.getProviderId(), input .getName(), input.getLocation(), input.getUri(), input.getETag(), input.getCreationDate(), input.getLastModified(), input.getUserMetadata()); } return input; } }), from.getNextMarker());
public StorageMetadata apply(BlobMetadata input) { if (input.getContentMetadata().getContentType().equals("application/directory")) { return new StorageMetadataImpl(StorageType.RELATIVE_PATH, input.getProviderId(), input .getName(), input.getLocation(), input.getUri(), input.getETag(), input.getCreationDate(), input.getLastModified(), input.getUserMetadata()); } return input; } }), from.getNextMarker());
public StorageMetadata apply(BlobMetadata input) { if (input.getContentMetadata().getContentType().equals("application/directory")) { return new StorageMetadataImpl(StorageType.RELATIVE_PATH, input.getProviderId(), input .getName(), input.getLocation(), input.getUri(), input.getETag(), input.getCreationDate(), input.getLastModified(), input.getUserMetadata()); } return input; } }), from.getNextMarker());
public MutableObjectMetadata apply(BlobMetadata from) { if (from == null) return null; MutableObjectMetadata to = new MutableObjectMetadataImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setUri(from.getUri()); to.setETag(from.getETag()); to.setKey(from.getName()); to.setBucket(bucket); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } if (from.getTier() != null) { to.setStorageClass(StorageClass.fromTier(from.getTier())); } return to; }
public MutableObjectMetadata apply(BlobMetadata from) { if (from == null) return null; MutableObjectMetadata to = new MutableObjectMetadataImpl(); HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata()); to.setUri(from.getUri()); to.setETag(from.getETag()); to.setKey(from.getName()); to.setBucket(bucket); to.setLastModified(from.getLastModified()); if (from.getUserMetadata() != null) { for (Entry<String, String> entry : from.getUserMetadata().entrySet()) to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue()); } if (from.getTier() != null) { to.setStorageClass(StorageClass.fromTier(from.getTier())); } return to; }
@Test(groups = { "integration", "live" }) public void testETag() throws Exception { String blobName = "test-etag"; ByteSource payload = ByteSource.empty(); BlobStore blobStore = view.getBlobStore(); String containerName = getContainerName(); try { Blob blob = blobStore.blobBuilder(blobName) .payload(payload) .contentLength(payload.size()) .build(); String eTag = blobStore.putBlob(containerName, blob); assertThat(eTag).hasSize(44); BlobMetadata metadata = blobStore.blobMetadata(containerName, blobName); assertThat(metadata.getETag()).isEqualTo(eTag); for (StorageMetadata sm : blobStore.list(containerName, ListContainerOptions.NONE)) { assertThat(sm.getETag()).isEqualTo(eTag); } } finally { returnContainer(containerName); } } }
@Override public BlobMetadata apply(@Nullable org.jclouds.blobstore.domain.BlobMetadata input) { if (input == null) { return null; } return BlobMetadata.builder() .publicUri(input.getPublicUri()).type(input.getType().name()).providerId(input.getProviderId()) .name(input.getName()).uri(input.getUri()).userMetadata(input.getUserMetadata()) .eTag(input.getETag()).creationDate(input.getCreationDate()).lastModifiedDate(input.getLastModified()) .content(ToContentContentMetadata.INSTANCE.apply(input.getContentMetadata())) .build(); } }