我需要从容器中移除所有的blob。我认为简单的方法是删除并重新创建容器。与其说...Azure Java SDK - 如何知道容器何时被删除
这里是等待代码:
while (saClient.getContainerReference(myContainerName.exists()) {
try {
Thread.sleep(20 * 1000);
} catch (InterruptedException ie) {
Thread.interrupted();
System.out.println("<: interrupted");
return;
}
}
当我走出这个循环中,我尝试重新创建容器并得到异常:
com.microsoft.azure.storage.StorageException: The specified container is being deleted. Try operation later.
我可以重新编码删除每个blob,但很好奇这个接口的行为。我可能会遇到同样的问题,每个blob都不会被删除。
我使用这些库的版本:
com.microsoft.azure:azure-storage:4.2.0
com.microsoft.azure:azure:1.1.0
谢谢!我会尽量记住将来检查REST API文档。 Java SDK文档不是特定的。 – ddnamaste