@Override
    public URL getApiRoute(String apiRouteBase) throws MalformedURLException {
      StringBuilder url =
          new StringBuilder(apiRouteBase)
              .append(registryEndpointRequestProperties.getImageName())
              .append("/blobs/uploads/");
      if (sourceRepository != null) {
        url.append("?mount=").append(blobDigest).append("&from=").append(sourceRepository);
      }

      return new URL(url.toString());
    }
Returns a URL to continue pushing the BLOB to, or {@link Optional#empty()} if the BLOB
already exists on the registry.
jib-core/src/main/java/com/google/cloud/tools/jib/registry/BlobPusher.java