+ if rest:
+ dir = collection.find(rest)
+ else:
+ dir = collection
+ if dir is None:
+ raise IOError(errno.ENOENT, "Directory '%s' in '%s' not found" % (rest, collection.portable_data_hash()))
+ if not isinstance(dir, arvados.collection.Collection):
+ raise IOError(errno.ENOENT, "Path '%s' in '%s' is not a Directory" % (rest, collection.portable_data_hash()))