Create a relative ref url from the specified ref

@param ref the ref url to be made relative

@return the relative ref url or null if the specified ref was not valid
193827
public static String getRelativeRef(String ref) {
        Matcher matcher = match(ref);
        return matcher != null ? String.format("/%s/%s", matcher.group(1), matcher.group(2)) : null;
    }
1199670
public static URL toAbsolute(URL baseURL, String relative) {
        try {
            return new URL(baseURL, relative);
        } 
        catch (MalformedURLException ex) {
            throw new RuntimeException(ex);
        }
    }
534756
private ReferenceDescriptorDef cloneReference(ReferenceDescriptorDef refDef, String prefix)
    {
        ReferenceDescriptorDef copyRefDef = new ReferenceDescriptorDef(refDef, prefix);

        copyRefDef.setOwner(this);
        // we remove properties that are only relevant to the class the features are declared in
        copyRefDef.setProperty(PropertyHelper.OJB_PROPERTY_IGNORE, null);
        
        Properties mod = getModification(copyRefDef.getName());

        if (mod != null)
        {
            if (!PropertyHelper.toBoolean(mod.getProperty(PropertyHelper.OJB_PROPERTY_IGNORE), false) &&
                hasFeature(copyRefDef.getName()))
            {
                LogHelper.warn(true,
                               ClassDescriptorDef.class,
                               "process",
                               "Class "+getName()+" has a feature that has the same name as its included reference "+
                               copyRefDef.getName()+" from class "+refDef.getOwner().getName()); 
            }
            copyRefDef.applyModifications(mod);
        }
        return copyRefDef;
    }
510568
function(ref) {
        if (ref.category !== "objectref" || !ref.path || !ref.path.length || !ref.path.join) {
            return null;
        }
        return ref.path.join(".");
    }
241395
def get_git_ref(self, ref):
        
        prefix = "/git/refs/"
        if not self._requester.FIX_REPO_GET_GIT_REF:
            prefix = "/git/"
        assert isinstance(ref, (str, unicode)), ref
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + prefix + ref
        )
        return github.GitRef.GitRef(self._requester, headers, data, completed=True)
733245
def url(ref)
      config = self.class.config(@repo, ref)

      lookup = config.keys.inject({}) do |acc, key|
        id = config[key]['id']
        acc[id] = config[key]['url']
        acc
      end

      lookup[@id]
    end
1227345
def add_ref(self, ref, attr=None):
        
        self.session.add_ref(self, ref, attr)
        return self.fetch()
1247617
public static boolean resourceExists(String ref) {
		URL url = null;
		
		for (int i=0;i<locations.size();i++) {
			ResourceLocation location = (ResourceLocation) locations.get(i);
			url = location.getResource(ref);
			if (url != null) {
				return true;
			}
		}
		
		return false;
	}
654300
public static <T> Reference<T> create(ReferenceType type, T referent) {
		return create(type, referent, null);
	}
925053
public int addRef(Object ref)
    {
        if (_refs == null)
            _refs = new ArrayList();

        _refs.add(ref);

        return _refs.size() - 1;
    }
274960
@Override
    public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException {
        throw new FileNotFoundException("Cannot create a relative resource for " + getDescription());
    }
368922
public Query fromUrl(String uri) throws UrlBeautifier.UrlBeautificationException {
    Query query = fromUrl(uri, null);
    if (query == null) {
      throw new IllegalStateException("URL reference block is invalid, could not convert to query");
    }
    return query;
  }
645608
public static <T extends RefCounted<T>> Refs<T> tryRef(Iterable<T> reference)
    {
        HashMap<T, Ref<T>> refs = new HashMap<>();
        for (T rc : reference)
        {
            Ref<T> ref = rc.tryRef();
            if (ref == null)
            {
                release(refs.values());
                return null;
            }
            refs.put(rc, ref);
        }
        return new Refs<T>(refs);
    }
993108
public static Link create(final String text, final String ref) {
		return new Link(text, null, '#'+ref);
	}
567733
URI buildUri(String relativePath)
    {    
        URI uri = null;
        
        try
        {    
            uri = new URI(buildUrl(relativePath));   
        }
        catch (URISyntaxException e)
        {           
            logger.severe("Problem constructing URI: "+e.getClass().getName()+e.getMessage());
        }

        return uri;
    }
244717
function simpleRef(ref) {
  if (!ref) {
    return null;
  }
  var index = ref.lastIndexOf('/');
  if (index >= 0) {
    ref = ref.substr(index + 1);
  }
  return toClassName(ref);
}
1004982
def _make_refnode(self, fromdocname, builder, docname, labelid, sectname,
                      contnode, **kwargs):
        """"""
        nodeclass = kwargs.pop('nodeclass', nodes.reference)
        newnode = nodeclass('', '', internal=True, **kwargs)
        innernode = nodes.emphasis(sectname, sectname)
        if docname == fromdocname:
            newnode['refid'] = labelid
        else:
            # Set more info on contnode. In case the get_relative_uri call
            # raises NoUri, the builder will then have to resolve these.
            contnode = addnodes.pending_xref('')
            contnode['refdocname'] = docname
            contnode['refsectname'] = sectname
            newnode['refuri'] = builder.get_relative_uri(fromdocname, docname)
            if labelid:
                newnode['refuri'] += '#' + labelid
        newnode.append(innernode)
        return newnode