/*
Get the url of the image for the given conversionName
for first media for the given collectionName.
If no profile is given, return the source's url.
438708
public function getFirstMediaPath(string $collectionName = 'default', string $conversionName = ''): string
    {
        $media = $this->getFirstMedia($collectionName);

        if (! $media) {
            return '';
        }

        return $media->getPath($conversionName);
    }
959613
public URL getResourceURL(String name) {
		if (name.length() == 0) return null;
		if (name.charAt(0) == '/') name = name.substring(1);
    	for (int i = 0; i < libs.size(); i++) {
    		AbstractClassLoader cl = libs.get(i);
    		URL url = cl.loadResourceURL(name);
    		if (url != null) return url;
    	}
    	// then try on the core one
    	return AppClassLoader.class.getClassLoader().getResource(name);
	}
252335
function getUrl(file, size, media) {
      media = media || get_media;
      var version = new Date(file.updatedAt).valueOf();
      return media(file.location, size) + '?version=' + version;
    }
964219
def get_profile_media(profile, page = 0):
    
    try:
        edges = profile['entry_data']['ProfilePage'][page]['graphql']['user']['edge_owner_to_timeline_media']['edges']
        return [edge['node'] for edge in edges]
    except KeyError:
        logging.exception("path to profile media not found")
346907
public function getUrl(string $conversionName = ''): string
    {
        if ($this->hasFile()) {
            return $this->getFile()->getUrl();
        }
        return $this->getCollection()->getDefaultMediaUrl();
//        $urlGenerator = UrlGeneratorFactory::createForMedia($this);
//        if ($conversionName !== '') {
////            $conversion = ConversionCollection::createForMedia($this)->getByName($conversionName);
////            $urlGenerator->setConversion($conversion);
//        }
//        return $urlGenerator->getUrl();
    }
1339320
function getURLSource(url) {
      var urlRegExp = /(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/;
      var sources = Object.keys(Embedo.defaults.SOURCES) || [];

      if (!urlRegExp.test(url)) {
        return null;
      }

      var matched_source = sources
        .filter(function (source) {
          if (Embedo.defaults.SOURCES[source] && url.match(Embedo.defaults.SOURCES[source].REGEX)) {
            return source;
          }
        })
        .filter(Boolean);

      return matched_source && matched_source.length ? matched_source[0] : 'iframe';
    }
795282
def get_archive_url(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/archive",
            headers={
                "Accept": Consts.mediaTypeMigrationPreview
            }
        )
        return data["data"]
700054
@Override
  public URL getResource(String name) {

    URL result = null;

    if (bestCandidate != null) {
      result = bestCandidate.getResource(name);
      if (result == null) {
        bestCandidate = null;
      }
    }

    ClassLoadHelper loadHelper = null;

    Iterator<ClassLoadHelper> iter = loadHelpers.iterator();
    while (iter.hasNext()) {
      loadHelper = iter.next();

      result = loadHelper.getResource(name);
      if (result != null) {
        break;
      }
    }

    bestCandidate = loadHelper;
    return result;
  }
875356
public URL getImageUrl(BaseType baseType, String id) throws FanartTvException {
        StringBuilder url = getBaseUrl(baseType);

        // Add the ID
        url.append(id);

        // Add the API Key
        url.append(DELIMITER_APIKEY).append(apiKey);

        // Add the client API Key
        if (StringUtils.isNotBlank(clientKey)) {
            url.append(DELIMITER_CLIENT_KEY).append(clientKey);
        }

        return convertUrl(url);
    }
1052171
function formatUrlPref(prefName) {
  var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]
                     .getService(Ci.nsIURLFormatter);

  return formatter.formatURLPref(prefName);
}
599795
private String buildDownloadMediaUrl() {
    String resourcePath = this.resource.getPath();

    // if parent resource is a nt:file resource, use this one as path for scaled image
    Resource parentResource = this.resource.getParent();
    if (JcrBinary.isNtFile(parentResource)) {
      resourcePath = parentResource.getPath();
    }

    // URL to render scaled image via {@link InlineRenditionServlet}
    String path = resourcePath + "." + MediaFileServlet.SELECTOR
        + "." + MediaFileServlet.SELECTOR_DOWNLOAD
        + "." + MediaFileServlet.EXTENSION + "/" + getFileName();

    // build externalized URL
    UrlHandler urlHandler = AdaptTo.notNull(this.adaptable, UrlHandler.class);
    return urlHandler.get(path).urlMode(this.mediaArgs.getUrlMode()).buildExternalResourceUrl(this.resource);
  }
1321325
function getProcessedUrl(data, resourceName) {
                        // get the raw URL out of the resource name and check if it is valid
                        var url = data[config.linksKey][resourceName][config.linksHrefKey];

                        if (url === undefined || !url) {
                            throw new Error('The provided resource name "' + resourceName + '" has no valid URL in the "' +
                                config.linksHrefKey + '" property.');
                        }

                        // extract the template parameters of the raw URL
                        return extractUrl(url, data[config.linksKey][resourceName].templated);
                    }
822134
def url(self, name):
        
        key = blobstore.create_gs_key('/gs' + name)
        return images.get_serving_url(key)
108953
protected String buildGalleryUrl() {

        String basePath = "";
        basePath = "/system/workplace/commons/gallery.jsp";
        basePath += "?dialogmode=widget&fieldid=" + m_id;
        if (LINK.equals(m_type)) {
            basePath += "&" + I_CmsGalleryProviderConstants.CONFIG_RESOURCE_TYPES + "=pointer";
        }

        String pathparameter = m_selectionInput.m_textbox.getText();
        if (pathparameter.indexOf("/") > -1) {
            basePath += "&currentelement=" + pathparameter;
        }
        basePath += m_config;
        return CmsCoreProvider.get().link(basePath);
    }
374310
def profile_url(obj, profile_app_name, profile_model_name):
    
    try:
        content_type = ContentType.objects.get(
            app_label=profile_app_name,
            model=profile_model_name.lower()
        )
        profile = content_type.get_object_for_this_type(user=obj.user)
        return profile.get_absolute_url()
    except ContentType.DoesNotExist:
        return ""
    except AttributeError:
        return ""
923436
def get_thumbnail_image_url(self, page=1):
        
        template = self.resources.page.get('image')
        return template.replace(
            "{page}",
            str(page)
        ).replace("{size}", "thumbnail")
168694
def url(name = nil)
      if name
        if version_identifiers.include?(name.to_s)
          self[:@versions][name.to_s][:@url]
        else
          raise "Invalid Image Version identifier: '#{name}' (must be #{version_identifiers.join(', ')})"
        end
      else
        self[:@url]
      end
    end