code: public static boolean hasService(Class<?> service, URL[] urls)
              throws ServiceConfigurationError {
          for (URL url: urls) {
              try {
                  String fullName = prefix + service.getName();
                  URL u = new URL(url, fullName);
                  boolean found = parse(service, u);
                  if (found)
                      return true;
              } catch (MalformedURLException e) {
                  // should not happen; ignore it if it does
              }
          }
          return false;
      }
docs: Return true if a description for at least one service is found in the
  service configuration files in the given URLs.