class SwiftMetadataFeature implements Headers {

    @Override
    public Map<String, String> getMetadata(final Path file) throws BackgroundException {
        try {
            if(containerService.isContainer(file)) {
                final ContainerMetadata meta
                        = session.getClient().getContainerMetaData(regionService.lookup(file),
                        containerService.getContainer(file).getName());
                return meta.getMetaData();
            }
            else {
                final ObjectMetadata meta
                        = session.getClient().getObjectMetaData(regionService.lookup(file),
                        containerService.getContainer(file).getName(), containerService.getKey(file));
                return meta.getMetaData();
            }
        }
        catch(GenericException e) {
            throw new SwiftExceptionMappingService().map("Failure to read attributes of {0}", e, file);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map("Failure to read attributes of {0}", e, file);
        }
    }

    public  SwiftMetadataFeature(final SwiftSession session);
    public  SwiftMetadataFeature(final SwiftSession session, final SwiftRegionService regionService);

}