code: public static String parseBundleId(String url) {
          if (isOsgiBundleUrl(url)) {
              int slashesIdx = url.indexOf("://");
              return url.substring(slashesIdx + "://".length(), url.indexOf('.'));
          } else {
              return null;
          }
      }
docs: Parses OSGi bundle ID from the provided URL. The URL may not be coming from OSGi,
  in which case "null" is returned
  
  @param url URL
  @return parsed bundle ID, or null if the url is not OSGi bundle URL