It's as simple as getting a timestamp for an Azure Blob Storage object, but it's surprisingly annoying, so make a note of it. I think it is natural to give a time stamp to the object of BlobItem, but it seems that the design concept is different.
Maven POM
<!-- https://mvnrepository.com/artifact/com.microsoft.azure/azure-storage -->
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage</artifactId>
<version>8.4.0</version>
</dependency>
Code
import com.microsoft.azure.storage.*;
import com.microsoft.azure.storage.blob.*;
public class AzureHello {
public static final String storageConnectionString = "{your_connection_string}";
public static void main(String[] args) {
CloudStorageAccount storageAccount;
CloudBlobClient blobClient = null;
CloudBlobContainer container = null;
try {
storageAccount = CloudStorageAccount.parse(storageConnectionString);
blobClient = storageAccount.createCloudBlobClient();
container = blobClient.getContainerReference("{your_container_name}");
CloudBlob cb = container.getBlobReferenceFromServer("test.txt");
System.err.println(cb.getProperties().getLastModified());
...
}
}
}
Recommended Posts