    def text(self):
        components = (
            ical.Timezone, ical.Event, ical.Todo, ical.Journal, ical.Card)
        items = set()
        try:
            filenames = os.listdir(self._path)
        except (OSError, IOError) as e:
            log.LOGGER.info('Error while reading collection %r: %r'
                            % (self._path, e))
            return ""

        for filename in filenames:
            path = os.path.join(self._path, filename)
            try:
                with filesystem.open(path) as fd:
                    items.update(self._parse(fd.read(), components))
            except (OSError, IOError) as e:
                log.LOGGER.warning('Error while reading item %r: %r'
                                   % (path, e))

        return ical.serialize(
            self.tag, self.headers, sorted(items, key=lambda x: x.name))
This category has been deprecated. It was originally used for organizing weaknesses involving file names, which enabled access to files outside of a restricted directory (path traversal) or to perform operations on files that would otherwise be restricted (path equivalence). Consider using either the File Handling Issues category (CWE-1219) or the class Use of Incorrectly-Resolved Name or Reference (CWE-706).