static String getDirective(List<String> defLines, Pattern directivePattern) {
        Matcher matcher;
        for (String defLine : defLines) {
            if ((matcher = directivePattern.matcher(defLine)).matches()) {
                if ((matcher = packagePattern.matcher(matcher.group(1))).matches())
                    return matcher.group(1);
                else
                    throw new IllegalArgumentException("package (or namespace) must consist of one or more segments joined by single dots (.), " +
                                                       "each starting with a lowercase letter (a-z), and then containing one or more " +
                                                       "lowercase letters (a-z), digits (0-9), or underscores (_)");
            }
        }
        return null;
    }
Finds the def package or namespace from a reader for a def-file. Returns "" (empty string)
if no package or namespace was found. If both package and namespace are declared in the def
file, the package is returned.

@param in A reader to a def-file
@return namespace of the def-file, or "" (empty string) if no namespace was found
config/src/main/java/com/yahoo/vespa/config/util/ConfigUtils.java