':returns: The size of the object, or 0 if it doesn\'t exist (sorry for
that, not our fault, the ObjectStore interface is like that some
times)'

def size(self, obj, **kwargs):

    path = self._construct_path(obj, **kwargs)
    if self._in_cache(path):
        try:
            return os.path.getsize(self._get_cache_path(path))
        except OSError as ex:
            log.warning('Could    not    get    size    of    file    {path}    in    local    cache,will    try    Pithos.    Error:    {err}'.format(path=path, err=ex))
    try:
        file = self.pithos.get_object_info(path)
    except ClientError as ce:
        if (ce.status not in (404,)):
            raise
        return 0
    return int(file['content-length'])
