code: private ApplicationDefinition getApplication(String uri, Tenant tenant) {
          if (uri.length() < 2 || uri.startsWith("/_")) {
              return null;    // Non-application request
          }
          String[] pathNodes = uri.substring(1).split("/");
          String appName = Utils.urlDecode(pathNodes[0]);
          ApplicationDefinition appDef = SchemaService.instance().getApplication(tenant, appName);
          if (appDef == null) {
              throw new NotFoundException("Unknown application: " + appName);
          }
          return appDef;
      }
docs: Get the definition of the referenced application or null if there is none.