public static List getExcludesFromFile()

in apache-rat-plugin/src/main/java/org/apache/rat/mp/util/ScmIgnoreParser.java [53:77]


    public static List<String> getExcludesFromFile(final Log log, final File scmIgnore) {

        final List<String> exclusionLines = new ArrayList<>();

        if (scmIgnore != null && scmIgnore.exists() && scmIgnore.isFile()) {
            log.debug("Parsing exclusions from " + scmIgnore);
            BufferedReader reader = null;
            try {
                reader = new BufferedReader(new FileReader(scmIgnore));
                String line;
                while ((line = reader.readLine()) != null) {
                    if (!isComment(line)) {
                        exclusionLines.add(line);
                        log.debug("Added " + line);
                    }
                }
            } catch (final IOException e) {
                log.warn("Cannot parse " + scmIgnore + " for exclusions. Will skip this file.");
                log.debug("Skip parsing " + scmIgnore + " due to " + e.getMessage());
            } finally {
                IOUtils.closeQuietly(reader);
            }
        }
        return exclusionLines;
    }