public static Path getDataDirectory() {
        // Grand unified data directory!
        String dataDir = System.getProperty("apiman.data.dir");
        if (dataDir != null) {
            return Paths.get(dataDir);
        }

        // If that wasn't set, then check to see if we're running in wildfly/eap
        dataDir = System.getProperty("jboss.server.data.dir");
        if (dataDir != null) {
            return Paths.get(dataDir, "apiman");
        }

        // If that didn't work, try to locate a tomcat data directory
        dataDir = System.getProperty("catalina.home");
        if (dataDir != null) {
            return Paths.get(dataDir, "conf");
        }
        throw new IllegalStateException("No data directory has been set. Please set apiman.data.dir=<data dir>");
    }
Return the standard Apiman data directory.

Following precedence is used:
<ul>
    <li><code>${apiman.data.dir}</code></li>
    <li><code>${jboss.server.data.dir}</code></li>
    <li><code>${catalina.home}/data</code></li>
</ul>
common/config/src/main/java/io/apiman/common/config/ConfigDirectoryFinder.java