attributes.put("azure.etag", properties.getEtag()); attributes.put("azure.length", String.valueOf(length)); attributes.put("azure.timestamp", String.valueOf(properties.getLastModified())); } catch (StorageException | URISyntaxException e) { storedException.set(e);
.contentLanguage(properties.getContentLanguage()) .etag(properties.getEtag()) .lastModifiedTime(properties.getLastModified().getTime()) .length(properties.getLength());
@Override public long lastModified() throws IOException { return this.blockBlob.getProperties().getLastModified().getTime(); }
public static AzureBlobInfo fromCloudBlob(CloudBlob cloudBlob) { return new AzureBlobInfo(cloudBlob.getName(), cloudBlob.getProperties().getLastModified().getTime(), cloudBlob.getProperties().getLength()); } }
long lastModified = blob.getProperties().getLastModified().getTime(); long length = blob.getProperties().getLength(); AzureBlobStoreDataRecord record = new AzureBlobStoreDataRecord(this,
containerName, new DataIdentifier(stripMetaKeyPrefix(blob.getName())), blob.getProperties().getLastModified().getTime(), blob.getProperties().getLength(), true));
containerName, new DataIdentifier(getIdentifierName(blob.getName())), blob.getProperties().getLastModified().getTime(), blob.getProperties().getLength()); LOG.debug("Data record read for blob. identifier={} duration={} record={}",
" old length=" + blob.getProperties().getLength()); LOG.trace("Blob already exists. identifier={} lastModified={}", key, blob.getProperties().getLastModified().getTime()); blob.startCopy(blob); blob.getProperties().getLastModified().getTime(), (System.currentTimeMillis() - start));
return new FileMetadata(key, properties.getLastModified().getTime(), getPermissionStatus(blob), BlobMaterialization.Explicit, hadoopBlockSize); } else { properties.getLastModified().getTime(), getPermissionStatus(blob), hadoopBlockSize); return new FileMetadata(key, properties.getLastModified().getTime(), getPermissionStatus(blob), BlobMaterialization.Implicit, hadoopBlockSize);
eTag = Strings.nullToEmpty(properties.getEtag()); if (properties.getLastModified() != null) { lastModified.setTime(properties.getLastModified());
eTag = Strings.nullToEmpty(properties.getEtag()); if (properties.getLastModified() != null) { lastModified.setTime(properties.getLastModified());
final CloudBlob blob = (CloudBlob) object; attributes.setSize(blob.getProperties().getLength()); attributes.setModificationDate(blob.getProperties().getLastModified().getTime()); attributes.setETag(blob.getProperties().getEtag()); if(StringUtils.isNotBlank(blob.getProperties().getContentMD5())) {
final PathAttributes attributes = new PathAttributes(); attributes.setSize(properties.getLength()); attributes.setModificationDate(properties.getLastModified().getTime()); if(StringUtils.isNotBlank(properties.getContentMD5())) { attributes.setChecksum(Checksum.parse(Hex.encodeHexString(Base64.decodeBase64(properties.getContentMD5()))));
.getProperties().getLastModified())) { throw new StorageException(StorageErrorCode.CONDITION_FAILED.toString(), SR.INVALID_CONDITIONAL_HEADERS, HttpURLConnection.HTTP_PRECON_FAILED, null, null);
.getProperties().getLastModified())) { throw new StorageException(StorageErrorCode.CONDITION_FAILED.toString(), SR.INVALID_CONDITIONAL_HEADERS, HttpURLConnection.HTTP_PRECON_FAILED, null, null);
assertNotNull(copy.getProperties().getEtag()); assertFalse(source.getProperties().getEtag().equals(copy.getProperties().getEtag())); assertTrue(copy.getProperties().getLastModified().compareTo(new Date(calendar.get(Calendar.MINUTE) - 1)) > 0);
assertNotNull(destination.getProperties().getEtag()); assertFalse(source.getProperties().getEtag().equals(destination.getProperties().getEtag())); assertTrue(destination.getProperties().getLastModified().compareTo(new Date(calendar.get(Calendar.MINUTE) - 1)) > 0);
assertFalse(source.getProperties().getEtag() .equals(copy.getProperties().getEtag())); assertTrue(copy.getProperties().getLastModified() .compareTo(new Date(calendar.get(Calendar.MINUTE) - 1)) > 0);
public static void assertAreEqual(BlobProperties prop1, BlobProperties prop2) { if (prop1 == null) { assertNull(prop2); } else { assertNotNull(prop2); assertEquals(prop1.getBlobType(), prop2.getBlobType()); assertEquals(prop1.getCacheControl(), prop2.getCacheControl()); assertEquals(prop1.getContentDisposition(), prop2.getContentDisposition()); assertEquals(prop1.getContentEncoding(), prop2.getContentEncoding()); assertEquals(prop1.getContentLanguage(), prop2.getContentLanguage()); assertEquals(prop1.getContentMD5(), prop2.getContentMD5()); assertEquals(prop1.getContentType(), prop2.getContentType()); assertEquals(prop1.getEtag(), prop2.getEtag()); assertEquals(prop1.getLastModified(), prop2.getLastModified()); assertEquals(prop1.getLength(), prop2.getLength()); assertEquals(prop1.getPageBlobSequenceNumber(), prop2.getPageBlobSequenceNumber()); } }
assertEquals(props1.getLastModified(), props2.getLastModified()); assertEquals(props1.getCacheControl(), props2.getCacheControl());