private void addRankProfileFiles(String schemaName) throws ParseException {
        if (applicationPackage == null) return;

        Path legacyRankProfilePath = ApplicationPackage.SEARCH_DEFINITIONS_DIR.append(schemaName);
        for (NamedReader reader : applicationPackage.getFiles(legacyRankProfilePath, ".profile")) {
            mediator.addRankProfileFile(schemaName, reader);
        }

        Path rankProfilePath = ApplicationPackage.SCHEMAS_DIR.append(schemaName);
        for (NamedReader reader : applicationPackage.getFiles(rankProfilePath, ".profile", true)) {
            mediator.addRankProfileFile(schemaName, reader);
        }
    }
Registers the given schema to the application to be built during {@link #build}. A
{@link Schema} object is considered to be "raw" if it has not already been processed. This is the case for most
programmatically constructed schemas used in unit tests.

@param schema the object to import
@throws IllegalArgumentException if the given search object has already been processed
config-model/src/main/java/com/yahoo/schema/ApplicationBuilder.java