code: private static URL getConfigUrl() throws ConfigurationException {
          String spec = System.getProperty(CONFIG_URL_PROPERTY_NAME);
          if (spec == null) {
              spec = DEFAULT_CONFIG_URL;
          }
  
          URL configUrl = null;
          try {
              configUrl = new URL(spec);
              configUrl.openStream().close(); // catches well-formed but bogus URLs
          } catch (Exception e) {
              try {
                  File f = new File(spec);
                  if (f.exists()) {
                      configUrl = new URL("file:///" + f.getCanonicalPath());
                  }
              } catch( Exception ex) {
              }
          }
  
          if (configUrl == null) {
              ClassLoader loader = ServerParams.class.getClassLoader();
              configUrl = loader.getResource(spec);
  
              if (configUrl == null) {
                  throw new ConfigurationException("Can't find file/resource: \"" + spec + "\".");
              }
          }
  
          return configUrl;
      }
docs: Inspect the classpath to find configuration file