public static void validateIncludeDir(String dirName, FilesApplicationPackage app) {
        File file = new File(dirName);

        if (file.isAbsolute()) {
            throw new IllegalArgumentException("Cannot include directory '" + dirName +
                    "', absolute paths are not supported. Directory must reside in application package, " +
                    "and path must be given relative to application package.");
        }

        file = app.getFileReference(Path.fromString(dirName));

        if (!file.exists()) {
            throw new IllegalArgumentException("Cannot include directory '" + dirName +
                    "', as it does not exist. Directory must reside in application package, " +
                    "and path must be given relative to application package.");
        }

        if (!file.isDirectory()) {
            throw new IllegalArgumentException("Cannot include '" + dirName +
                    "', as it is not a directory. Directory must reside in application package, " +
                    "and path must be given relative to application package.");
        }
    }
Helper methods for directories included from services.xml in a &lt;include dir=''/&gt; element.

@author gjoranv
@since 5.1.19
config-application-package/src/main/java/com/yahoo/config/model/application/provider/IncludeDirs.java