Extracts container name from http://hostname/v1/auth_id/container/object

@param publicURL public url
@param accessURL access url
@return container name
559959
public static String extractDataRoot(String publicURL, String accessURL) {
    if (publicURL != null && !publicURL.startsWith("http")) {
      return "";
    }
    String reminder = publicURL.substring(accessURL.length() + 1);
    String container = null;
    if (reminder.indexOf("/") > 0) {
      container =  reminder.substring(0, reminder.indexOf("/"));
    } else {
      container = reminder;
    }
    if (container.endsWith("/")) {
      container = container.substring(0, container.length() - 1);
    }
    return container;
  }
1042165
protected String getContainerUrl() {
    String containerUrl = System.getProperty(CONTAINER_URL);
    if (containerUrl == null) {
      // fallback to look for a thread local variable. Only useful for testing
      // of JicUNit itself
      containerUrl = ContainerUrlHolder.get();
    }
    return containerUrl;
  }
430817
public void getAcl(String resourceName) throws Exception {

        CmsAccessControlList acList = m_cms.getAccessControlList(resourceName);
        Iterator<CmsUUID> principals = acList.getPrincipals().iterator();
        while (principals.hasNext()) {
            I_CmsPrincipal p = m_cms.lookupPrincipal(principals.next());
            m_shell.getOut().println(p.getName() + ": " + acList.getPermissions(p.getId()).getPermissionString());
        }
    }
806204
def get_access_id(self):
        
        access_id = self.get_as_nullable_string("access_id")
        access_id = access_id if access_id != None else self.get_as_nullable_string("client_id")
        return access_id
1336820
public static String getPullRequestName(String prUrl) {
        if (notEmpty(prUrl)) {
            int idx = prUrl.lastIndexOf("/");
            if (idx > 0) {
                return " #" + prUrl.substring(idx + 1);
            }
        }
        return "";
    }
1295130
public OvhPool serviceName_accessPoint_accessPointId_GET(String serviceName, Long accessPointId) throws IOException {
		String qPath = "/horizonView/{serviceName}/accessPoint/{accessPointId}";
		StringBuilder sb = path(qPath, serviceName, accessPointId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhPool.class);
	}
78931
@SuppressWarnings("PMD.AvoidLiteralsInIfCondition")
    public Token getAuthorizationToken(final ContainerRequest request) {
        String authorizationString = request.getHeaderString("Authorization");
        if (authorizationString != null && !"".equals(authorizationString)) {
            authorizationString = authorizationString.trim();
            final String[] components = authorizationString.split("\\s");
            if (components.length != 2) {
                throw new NotAuthorizedException(authenticationType);
            }
            final String scheme = components[0];
            if (!authenticationType.equalsIgnoreCase(scheme)) {
                throw new NotAuthorizedException(authenticationType);
            }
            final String tokenString = components[1];
            return Token.fromString(tokenString);
        }
        return null;
    }
239332
public com.google.protobuf.ByteString
      getAuthorizationUrlBytes() {
    java.lang.Object ref = authorizationUrl_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      authorizationUrl_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
516113
public String getAuthority(HttpUrl url) {
        String scheme = url.scheme();
        String host = url.host();
        int port = url.port();
        StringBuilder builder = new StringBuilder();
        if (scheme != null) {
            builder.append(scheme).append("://");
        }
        builder.append(host);
        if (port >= 0) {
            builder.append(':').append(port);
        }
        return builder.toString();
    }
979028
public function findAlias($publicUrl, $internalUrl)
    {
        $ret = null;

        $params = ['public_url' => $publicUrl, 'internal_url' => $internalUrl];
        if ($alias = $this->getRepository()->findOneBy($params)) {
            $ret = $alias;
        }

        return $ret;
    }
136999
public static function getFirewallWithAccessListenerNames(Container $container)
    {
        $names = [];

        foreach (self::getFirewallNames($container) as $firewallName) {
            /** @var FirewallContext $firewall */
            $firewall = $container->get(sprintf('security.firewall.map.context.%s', $firewallName));

            if (0 === count($firewall->getContext())) {
                continue;
            }

            $firewallContext = $firewall->getContext();
            if (false === isset($firewallContext[0]) || 0 === count($firewallContext[0])) {
                continue;
            }

            foreach ($firewallContext[0] as $listener) {
                if ($listener instanceof AccessListener) {
                    $names[] = $firewallName;
                }
            }
        }

        return $names;
    }
1027680
static CertStore getInstance(AccessDescription ad) {
        if (!ad.getAccessMethod().equals((Object)
                AccessDescription.Ad_CAISSUERS_Id)) {
            return null;
        }
        GeneralNameInterface gn = ad.getAccessLocation().getName();
        if (!(gn instanceof URIName)) {
            return null;
        }
        URI uri = ((URIName) gn).getURI();
        try {
            return URICertStore.getInstance
                (new URICertStore.URICertStoreParameters(uri));
        } catch (Exception ex) {
            if (debug != null) {
                debug.println("exception creating CertStore: " + ex);
                ex.printStackTrace();
            }
            return null;
        }
    }
1215150
public static String extractHostname(final String host) {
        String extracted = host;
        if (containsUserName(host)) {
            extracted = host.substring(host.indexOf("@") + 1, host.length());
        }

        if (containsPort(extracted)) {
            extracted = host.substring(0, host.indexOf(":"));
        }

        return extracted;
    }
424637
public function resolveService($arg, Container $container, $alias = "")
    {
        if (!is_string($alias)) {
            $alias = "";
        }
        if ($arg[0] == ContainerBuilder::SERVICE_CHAR) {
            $originalName = substr($arg, 1);
            $name = $this->aliasThisKey($originalName, $alias);
            // check if the service exists
            if (!$container->offsetExists($name)) {
                // check the un-aliased name
                $name = $originalName;

                if (!$container->offsetExists($name)) {
                    // check for private services if we have an alias to work with

                    $privateName = $originalName;
                    // alias the name if it wasn't already
                    if (!empty($alias) && strpos($originalName, $alias) === false) {
                        $privateName = $this->aliasThisKey($privateName, $alias);
                    }

                    // accessing private services from an unaliased context should always fail
                    if (
                        empty($alias) ||
                        empty($this->privateServices[$privateName]) || 
                        !$container->offsetExists($this->privateServices[$privateName])
                    ) {
                        // no private service either, or the private service key doesn't exist in the container (WTF?!)
                        throw new ReferenceException(sprintf("Tried to inject the service '%s', but it doesn't exist", $name));
                    }
                    
                    $name = $this->privateServices[$privateName];
                }

            }
            $arg = $container[$name];
        }
        return $arg;
    }
1044318
@Nullable
    public Container getContainerWithName(@Nonnull String name) {
        if (name == null || name.trim().length() == 0) {
            throw new IllegalArgumentException("A container name must be provided.");
        }

        for (Container container : getContainers()) {
            if (container.getName().equals(name)) {
                return container;
            }
        }

        return null;
    }
823691
public static String urlToHost(String url) {
		String lcUrl = url.toLowerCase();
		if(lcUrl.startsWith(DNS_SCHEME)) {
			return lcUrl.substring(DNS_SCHEME.length());
		}
		for(String scheme : ALL_SCHEMES) {
			if(lcUrl.startsWith(scheme)) {
				int authorityIdx = scheme.length();

				Matcher m = 
					HOST_REGEX_SIMPLE.matcher(lcUrl.substring(authorityIdx));
				if(m.find()) {
					return m.group(1);
				}
			}
		}
		return url;
	}
63650
def get_container_name(self, repo: str, branch: str, git_repo: Repo):
        
        return "arca_{}_{}_{}".format(
            self._arca.repo_id(repo),
            branch,
            self._arca.current_git_hash(repo, branch, git_repo, short=True)
        )