Esempio n. 1
0
 def isdir(self, fn):  # type: (unicode) -> bool
     collection, rest = self.get_collection(fn)
     if collection:
         if rest:
             return isinstance(collection.find(rest), arvados.collection.RichCollectionBase)
         else:
             return True
     else:
         return super(CollectionFsAccess, self).isdir(fn)
Esempio n. 2
0
 def isdir(self, fn):  # type: (unicode) -> bool
     collection, rest = self.get_collection(fn)
     if collection is not None:
         if rest:
             return isinstance(collection.find(rest), arvados.collection.RichCollectionBase)
         else:
             return True
     else:
         return super(CollectionFsAccess, self).isdir(fn)
Esempio n. 3
0
 def isfile(self, fn):  # type: (unicode) -> bool
     collection, rest = self.get_collection(fn)
     if collection:
         if rest:
             return isinstance(collection.find(rest), arvados.arvfile.ArvadosFile)
         else:
             return False
     else:
         return super(CollectionFsAccess, self).isfile(fn)
Esempio n. 4
0
 def isfile(self, fn):  # type: (unicode) -> bool
     collection, rest = self.get_collection(fn)
     if collection is not None:
         if rest:
             return isinstance(collection.find(rest), arvados.arvfile.ArvadosFile)
         else:
             return False
     else:
         return super(CollectionFsAccess, self).isfile(fn)
Esempio n. 5
0
 def size(self, fn):  # type: (unicode) -> bool
     collection, rest = self.get_collection(fn)
     if collection is not None:
         if rest:
             arvfile = collection.find(rest)
             if isinstance(arvfile, arvados.arvfile.ArvadosFile):
                 return arvfile.size()
         raise IOError(errno.EINVAL, "Not a path to a file %s" % (fn))
     else:
         return super(CollectionFsAccess, self).size(fn)
Esempio n. 6
0
 def listdir(self, fn):  # type: (unicode) -> List[unicode]
     collection, rest = self.get_collection(fn)
     if rest:
         dir = collection.find(rest)
     else:
         dir = collection
     if collection:
         return [abspath(l, fn) for l in dir.keys()]
     else:
         return super(CollectionFsAccess, self).listdir(fn)
Esempio n. 7
0
 def size(self, fn):  # type: (unicode) -> bool
     collection, rest = self.get_collection(fn)
     if collection is not None:
         if rest:
             arvfile = collection.find(rest)
             if isinstance(arvfile, arvados.arvfile.ArvadosFile):
                 return arvfile.size()
         raise IOError(errno.EINVAL, "Not a path to a file %s" % (fn))
     else:
         return super(CollectionFsAccess, self).size(fn)
Esempio n. 8
0
 def listdir(self, fn):  # type: (unicode) -> List[unicode]
     collection, rest = self.get_collection(fn)
     if collection:
         if rest:
             dir = collection.find(rest)
         else:
             dir = collection
         return [abspath(l, fn) for l in dir.keys()]
     else:
         return super(CollectionFsAccess, self).listdir(fn)
Esempio n. 9
0
 def listdir(self, fn):  # type: (unicode) -> List[unicode]
     collection, rest = self.get_collection(fn)
     if collection:
         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.RichCollectionBase):
             raise IOError(errno.ENOENT, "Path '%s' in '%s' is not a Directory" % (rest, collection.portable_data_hash()))
         return [abspath(l, fn) for l in dir.keys()]
     else:
         return super(CollectionFsAccess, self).listdir(fn)
Esempio n. 10
0
 def listdir(self, fn):  # type: (unicode) -> List[unicode]
     collection, rest = self.get_collection(fn)
     if collection is not None:
         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.RichCollectionBase):
             raise IOError(errno.ENOENT, "Path '%s' in '%s' is not a Directory" % (rest, collection.portable_data_hash()))
         return [abspath(l, fn) for l in list(dir.keys())]
     else:
         return super(CollectionFsAccess, self).listdir(fn)