class DefaultRootLocator implements RootLocator {

    public boolean isRootDirectory(Path dir) {<FILL_FUNCTION_BODY>}
}

        if (Files.isDirectory(dir.resolve(".mvn"))) {
            return true;
        }
        // we're too early to use the modelProcessor ...
        Path pom = dir.resolve("pom.xml");
        try (InputStream is = Files.newInputStream(pom)) {
            XMLStreamReader parser = new WstxInputFactory().createXMLStreamReader(is);
            if (parser.nextTag() == XMLStreamReader.START_ELEMENT
                    && parser.getLocalName().equals("project")) {
                for (int i = 0; i < parser.getAttributeCount(); i++) {
                    if ("root".equals(parser.getAttributeLocalName(i))) {
                        return Boolean.parseBoolean(parser.getAttributeValue(i));
                    }
                }
            }
        } catch (IOException | XMLStreamException e) {
            // The root locator can be used very early during the setup of Maven,
            // even before the arguments from the command line are parsed.  Any exception
            // that would happen here should cause the build to fail at a later stage
            // (when actually parsing the POM) and will lead to a better exception being
            // displayed to the user, so just bail out and return false.
        }
        return false;
    
<no_super_class>