(self, path)
return ls
Recursively delete unaccepted files based on their mimetype
        and return the final number or files in the directory.
Recursively delete unaccepted files based on their mimetype
        and return the final number or files in the directory.
Recursively delete unaccepted files based on their mimetype and return the final number or files in the directory .
def _remove_unaccepted_files(self, path):
        """
        Recursively delete unaccepted files based on their mimetype
        and return the final number or files in the directory.
        """
        ls = []
        for p in map(lambda x:os.path.join(path, x), os.listdir(path)):
            if os.path.islink(p):
                raise Exception(ElfinderErrorMessages.ERROR_ARC_SYMLINKS)
            mime = self._local_file_mimetype(p)
            if not self.mime_accepted(mime) or not self._name_accepted(self._basename(p)):
                if mime != 'directory':
                    os.unlink(p)
                else:
                    shutil.rmtree(p)
            elif mime != 'directory' or self._remove_unaccepted_files(p):
                ls.append(p)
        return ls
def _remove_unaccepted_files ( self , path ) : ls = [ ] for p in map ( lambda x : os . path . join ( path , x ) , os . listdir ( path ) ) : if os . path . islink ( p ) : raise Exception ( ElfinderErrorMessages . ERROR_ARC_SYMLINKS ) mime = self . _local_file_mimetype ( p ) if not self . mime_accepted ( mime ) or not self . _name_accepted ( self . _basename ( p ) ) : if mime != 'directory' : os . unlink ( p ) else : shutil . rmtree ( p ) elif mime != 'directory' or self . _remove_unaccepted_files ( p ) : ls . append ( p ) return ls