class AccuRevHistoryParser implements Executor.StreamHandler {

    private AccuRevRepository repository;
    private History history;

    /**
     * Parse the history for the specified file.
     *
     * @param file the file to parse history for
     * @param repos Pointer to the {@code AccuRevRepository}
     * @return object representing the file's history
     * @throws HistoryException if a problem occurs while executing p4 command
     */
    History parse(File file, Repository repos) throws HistoryException {<FILL_FUNCTION_BODY>}

    @Override
    public void processStream(InputStream input) throws IOException {

        BufferedReader in = new BufferedReader(new InputStreamReader(input));
        List<HistoryEntry> entries = new ArrayList<>();
        String line;
        String user;
        Date date;
        HistoryEntry entry = null;

        history = new History();

        /*
         * Accurev history of an element (directory or file) looks like:
         *
         * NOSONAR element: /./path/to/element eid: 238865 transaction 1486194; purge;
         * 2012/02/28 12:46:55 ; user: tluksha version 2541/1 (2539/1)
         *
         * transaction 1476285; purge; 2012/02/03 12:16:25 ; user: shaehn
         * version 4241/1 (4241/1)
         *
         * transaction 1317224; promote; 2011/05/03 11:37:56 ; user: mtrinh #
         * changes to ngb to compile on windows version 13/93 (1000/2)
         *
         * ...
         *
         * What is of interest then is: user (author), version (revision), date,
         * comment (message)
         *
         * Any lines not recognized are ignored.
         */
        while ((line = in.readLine()) != null) {

            if (line.startsWith("e")) {
                continue;
            } // ignore element, eid

            if (line.startsWith("t")) {             // found transaction

                String[] data = line.split("; ");
                entry = new HistoryEntry();

                user = data[3].replaceFirst("user: ", "");

                entry.setMessage("");
                entry.setAuthor(user);

                try {
                    date = repository.parse(data[2]);
                    entry.setDate(date);
                } catch (ParseException pe) {
                    //
                    // Overriding processStream() thus need to comply with the
                    // set of exceptions it can throw.
                    //
                    throw new IOException("Could not parse date: " + line, pe);
                }

            } else if (line.startsWith("  #") && (entry != null)) {  // found comment

                entry.appendMessage(line.substring(3));

            } else if (line.startsWith("  v") && (entry != null)) {  // found version

                String[] data = line.split("\\s+");
                entry.setRevision(data[2]);
                entry.setActive(true);
                entries.add(entry);
            }
        }

        history.setHistoryEntries(entries);
    }
}


        repository = (AccuRevRepository) repos;

        history = null;

        String relPath = repository.getDepotRelativePath(file);

        /*
         * When the path given is really just the root to the source
         * workarea, no history is available, create fake.
         */

        String rootRelativePath = File.separator + "." + File.separator;

        if (relPath.equals(rootRelativePath)) {

            List<HistoryEntry> entries = new ArrayList<>();

            entries.add(new HistoryEntry(
                    "", new Date(), "OpenGrok", "Workspace Root", true));

            history = new History(entries);

        } else {
            /*
             * Errors will be logged, so not bothering to add to the output.
             */
            Executor executor = repository.getHistoryLogExecutor(file);
            executor.exec(true, this);

        }

        return history;
    
<no_super_class>