'Returns the AFF4 URN this pathspec will be stored under.
Args:
client_urn: A ClientURN.
Returns:
A urn that corresponds to this pathspec.
Raises:
ValueError: If pathspec is not of the correct type.'

def AFF4Path(self, client_urn):

    if (not self.HasField('pathtype')):
        raise ValueError("Can't    determine    AFF4    path    without    a    valid    pathtype.")
    first_component = self[0]
    dev = first_component.path
    if first_component.HasField('offset'):
        dev += (':' + str((first_component.offset / 512)))
    if ((len(self) > 1) and (first_component.pathtype == PathSpec.PathType.OS) and (self[1].pathtype == PathSpec.PathType.TSK)):
        result = [self.AFF4_PREFIXES[PathSpec.PathType.TSK], dev]
        start = 1
    else:
        result = [self.AFF4_PREFIXES[first_component.pathtype]]
        start = 0
    for p in self[start]:
        component = p.path
        if p.HasField('offset'):
            component += (':' + str((p.offset / 512)))
        if p.HasField('stream_name'):
            component += (':' + p.stream_name)
        result.append(component)
    return client_urn.Add('/'.join(result))
