private static void storeVersionAttribute(CloudBlobContainerWrapper container) { HashMap<String, String> metadata = container.getMetadata(); if (null == metadata) { metadata = new HashMap<String, String>(); } metadata.put(VERSION_METADATA_KEY, CURRENT_WASB_VERSION); if (metadata.containsKey(OLD_VERSION_METADATA_KEY)) { metadata.remove(OLD_VERSION_METADATA_KEY); } container.setMetadata(metadata); }
private static String retrieveVersionAttribute( CloudBlobContainerWrapper container) { HashMap<String, String> metadata = container.getMetadata(); if (metadata == null) { return null; } else if (metadata.containsKey(VERSION_METADATA_KEY)) { return metadata.get(VERSION_METADATA_KEY); } else if (metadata.containsKey(OLD_VERSION_METADATA_KEY)) { return metadata.get(OLD_VERSION_METADATA_KEY); } else { return null; } }