code: public static Integer getPort(String resourcePath, RmiEndpointConfiguration endpointConfiguration) {
          if (resourcePath.contains(":")) {
              String portSpec = resourcePath.split(":")[1];
  
              if (portSpec.contains("/")) {
                  portSpec = portSpec.substring(0, portSpec.indexOf('/'));
              }
  
              return Integer.valueOf(portSpec);
          }
  
          return endpointConfiguration.getPort();
      }
docs: Extract port number from resource path. If not present use default port from endpoint configuration.
  @param resourcePath
  @param endpointConfiguration
  @return