@Override
    public PathAttributes find(final Path file, final ListProgressListener listener) throws BackgroundException {
        if(file.isRoot()) {
            return PathAttributes.EMPTY;
        }
        try {
            if(containerService.isContainer(file)) {
                final PathAttributes attributes = new PathAttributes();
                final CloudBlobContainer container = session.getClient().getContainerReference(containerService.getContainer(file).getName());
                container.downloadAttributes(null, null, context);
                final BlobContainerProperties properties = container.getProperties();
                attributes.setETag(properties.getEtag());
                attributes.setModificationDate(properties.getLastModified().getTime());
                return attributes;
            }
            if(file.isFile() || file.isPlaceholder()) {
                try {
                    final CloudBlob blob = session.getClient().getContainerReference(containerService.getContainer(file).getName())
                            .getBlobReferenceFromServer(containerService.getKey(file));
                    final BlobRequestOptions options = new BlobRequestOptions();
                    blob.downloadAttributes(AccessCondition.generateEmptyCondition(), options, context);
                    return this.toAttributes(blob);
                }
                catch(StorageException e) {
                    switch(e.getHttpStatusCode()) {
                        case HttpStatus.SC_NOT_FOUND:
                            if(file.isPlaceholder()) {
                                // Ignore failure and look for common prefix
                                break;
                            }
                        default:
                            throw e;
                    }
                }
            }
            // Check for common prefix
            try {
                new AzureObjectListService(session, context).list(file, new CancellingListProgressListener());
                return PathAttributes.EMPTY;
            }
            catch(ListCanceledException l) {
                // Found common prefix
                return PathAttributes.EMPTY;
            }
        }
        catch(StorageException e) {
            throw new AzureExceptionMappingService().map("Failure to read attributes of {0}", e, file);
        }
        catch(URISyntaxException e) {
            throw new NotfoundException(e.getMessage(), e);
        }
    }
@Test
    public void testFindContainer() throws Exception {
        final Path container = new Path(new AlphanumericRandomStringService().random().toLowerCase(Locale.ROOT), EnumSet.of(Path.Type.directory, Path.Type.volume));
        new AzureDirectoryFeature(session, null).mkdir(container, new TransferStatus());
        final AzureAttributesFinderFeature f = new AzureAttributesFinderFeature(session, null);
        final PathAttributes attributes = f.find(container);
        assertNotEquals(PathAttributes.EMPTY, attributes);
        assertNotNull(attributes.getETag());
        new AzureDeleteFeature(session, null).delete(Collections.singletonList(container), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }