+ return self.collections[pdh]
+
+
+class CollectionFsAccess(cwltool.stdfsaccess.StdFsAccess):
+ """Implement the cwltool FsAccess interface for Arvados Collections."""
+
+ def __init__(self, basedir, collection_cache=None):
+ super(CollectionFsAccess, self).__init__(basedir)
+ self.collection_cache = collection_cache
+
+ def get_collection(self, path):
+ sp = path.split("/", 1)
+ p = sp[0]
+ if p.startswith("keep:") and arvados.util.keep_locator_pattern.match(p[5:]):
+ pdh = p[5:]
+ return (self.collection_cache.get(pdh), sp[1] if len(sp) == 2 else None)