Extract the relative path to the current resource provider.
E.g. subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Foo/foos/foo1 will return foos/foo1.

@param id the id of the resource
@return the relative path
764440
public static String relativePathFromResourceId(String id) {
        if (id == null) {
            return null;
        }
        String[] paths = id.split("/providers/" + resourceProviderFromResourceId(id) + "/", 2);
        if (paths.length == 1) {
            return "";
        } else {
            return paths[1];
        }
    }
605677
public static String extractFromResourceId(String id, String identifier) {
        if (id == null || identifier == null) {
            return id;
        }
        Pattern pattern = Pattern.compile(identifier + "/[-\\w._]+");
        Matcher matcher = pattern.matcher(id);
        if (matcher.find()) {
            return matcher.group().split("/")[1];
        } else {
            return null;
        }
    }
531112
public String getRelativePath() {
       if (basePath == null) {
           return source.toString();
       }

       return basePath.relativize(source).toString();
    }
1015622
public function path($id = null)
	{
		if (! isset($this->resource_path)) {
			throw new \InvalidArgumentException(static::class . ' does not implement a resource path definition.');
		}

		return is_null($id) ? $this->url($this->resource_path) : $this->url("$this->resource_path/$id");
	}
914021
public static DataSourceBackendId getInstance(String id) {
        DataSourceBackendId result = cache.get(id);
        if (result == null) {
            id = id.intern();
            result = new DataSourceBackendId(id);
            cache.put(id, result);
        }
        return result;
    }
388716
private String pathToItem(String id) {
		return subDirForId(id) + UNIX_PATH_SEPERATOR + id.substring(SUBDIR_POLICY);
	}
52702
function find(id) {
  let filepath = '';

  if ('string' == typeof id) {
    try {
      // Resolve relative to buddy package
      filepath = require.resolve(id);
    } catch (err) {
      // Resolve relative to project package
      filepath = resolve(path.resolve('package.json'), id);
    }
  }

  return filepath;
}
140179
function getPath($ID)
	{
	    $res = $this->{$this->type ()}->pathConditional ( "ID=?", $ID );
	    $out = null;
	    if (is_array ( $res ))
	        foreach ( $res as $r )
	            if ($r ['ID'] == 1)
	                $out = '/';
	            else
	                $out .= "/" . $r ['Title'];
	            if (strlen ( $out ) > 1)
	                return substr ( $out, 1 );
	            else
	                return $out;
	}
445446
public Permalink get(String id) {
        for (Permalink p : this)
            if(p.getId().equals(id))
                return p;
        return null;
    }
531732
public static String parentResourceIdFromResourceId(String id) {
        if (id == null) {
            return null;
        }
        ResourceId resourceId = ResourceId.fromString(id);
        if (resourceId != null && resourceId.parent() != null) {
            return ResourceId.fromString(id).parent().id();
        }

        return null;
    }
630600
@GET
    @Path("/{id}")
    public Response find(@PathParam("id") final String id)
            throws IOException {
        return execute(getResourceRequest(RequestTypeEnum.GET, RestOperationTypeEnum.READ).id(id));
    }
480438
public String getRelativePath() {
        final StringBuilder builder = new StringBuilder();
        for(final String p : path) {
            builder.append(p).append("/");
        }
        builder.append(getName());
        return builder.toString();
    }
1115886
protected String getRelativePath(final HttpServletRequest request) {
		// IMPORTANT: DefaultServlet can be mapped to '/' or '/path/*' but
		// always
		// serves resources from the web app root with context rooted paths.
		// i.e. it can not be used to mount the web app root under a sub-path
		// This method must construct a complete context rooted path, although
		// subclasses can change this behaviour.

		// Are we being processed by a RequestDispatcher.include()?
		if (request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI) != null) {
			String result = (String) request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO);
			if (result == null) {
				result = (String) request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH);
			} else {
				result = (String) request.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH) + result;
			}
			if ((result == null) || (result.equals(""))) {
				result = "/";
			}
			return (result);
		}

		// No, extract the desired path directly from the request
		String result = request.getPathInfo();
		if (result == null) {
			result = request.getServletPath();
		} else {
			result = request.getServletPath() + result;
		}
		if ((result == null) || (result.equals(""))) {
			result = "/";
		}
		return (result);

	}
904281
private String getSubdirectoryPath(String resourceId) {
    String subdirectory = String.valueOf(Math.abs(resourceId.hashCode() % SHARDING_BUCKET_COUNT));
    return mVersionDirectory + File.separator + subdirectory;
  }
432486
public T getProvider(final String id) {
        return (T) beanFactory.getBean(providerFactory.beanName(id));
    }
385169
public static String subscriptionFromResourceId(String id) {
        return (id != null) ? ResourceId.fromString(id).subscriptionId() : null;
    }
193803
public String getIdValue(final URI id) {
        if (id == null) {
            return null;
        }
        final URI localId = id.normalize();
        return idMap.get(localId);
    }