All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openapi4j.core.model.reference.ReferenceUrl Maven / Gradle / Ivy

package org.openapi4j.core.model.reference;

import java.net.MalformedURLException;
import java.net.URL;

class ReferenceUrl {
  private ReferenceUrl() {}

  static URL resolve(URL url, String refValue) {
    if (refValue == null) {
      return url;
    }

    try {
      return new URL(url, refValue);
    } catch (MalformedURLException e) {
      return url;
    }
  }

  static String resolveAsString(URL url, String refValue) {
    return resolve(url, refValue).toString();
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy