'Returns a pathspec for an aff4 object even if there is none stored.'

@property
def real_pathspec(self):

    pathspec = self.Get(self.Schema.PATHSPEC)
    stripped_components = []
    parent = self
    while ((not pathspec) and (len(parent.urn.Split()) > 1)):
        stripped_components.append(parent.urn.Basename())
        pathspec = parent.Get(parent.Schema.PATHSPEC)
        parent = FACTORY.Open(parent.urn.Dirname(), token=self.token)
    if pathspec:
        if stripped_components:
            new_path = utils.JoinPath(*reversed(stripped_components[:(-1)]))
            pathspec.Append(rdf_paths.PathSpec(path=new_path, pathtype=pathspec.last.pathtype))
    else:
        raise IOError('Item    has    no    pathspec.')
    return pathspec
