Returns the normalized application path found in any of the given class results.

@return The base URI of the application
504544
static String getApplicationPath(final Set<ClassResult> classResults) {
        return classResults.stream().map(ClassResult::getApplicationPath).filter(Objects::nonNull)
                .map(PathNormalizer::normalize).findAny().orElse("");
    }
71107
private static URL getClassPathURL(String resourceName, URL resourceURL) {
    try {
      if ("file".equals(resourceURL.getProtocol())) {
        String path = resourceURL.getFile();
        // Compute the directory container the class.
        int endIdx = path.length() - resourceName.length();
        if (endIdx > 1) {
          // If it is not the root directory, return the end index to remove the trailing '/'.
          endIdx--;
        }
        return new URL("file", "", -1, path.substring(0, endIdx));
      }
      if ("jar".equals(resourceURL.getProtocol())) {
        String path = resourceURL.getFile();
        return URI.create(path.substring(0, path.indexOf("!/"))).toURL();
      }
    } catch (MalformedURLException e) {
      throw Throwables.propagate(e);
    }
    throw new IllegalStateException("Unsupported class URL: " + resourceURL);
  }
1143135
private static URL findBaseURI(final Element root) {
        URL baseURI = null;
        final List<Element> linksList = root.getChildren("link", OS_NS);
        if (linksList != null) {
            for (final Element element : linksList) {
                final Element link = element;
                if (!root.equals(link.getParent())) {
                    break;
                }
                String href = link.getAttribute("href").getValue();
                if (link.getAttribute("rel", OS_NS) == null || link.getAttribute("rel", OS_NS).getValue().equals("alternate")) {
                    href = resolveURI(null, link, href);
                    try {
                        baseURI = new URL(href);
                        break;
                    } catch (final MalformedURLException e) {
                        System.err.println("Base URI is malformed: " + href);
                    }
                }
            }
        }
        return baseURI;
    }
887573
protected String getBaseUri() {
        if (mSession != null && mSession.getAuthInfo() != null && mSession.getAuthInfo().getBaseDomain() != null){
            return String.format(BoxConstants.BASE_URI_TEMPLATE,mSession.getAuthInfo().getBaseDomain());
        }
        return mBaseUri;
    }
1221420
@Pure
	public static Iterator<URL> getClasspath() {
		Iterator<URL> iterator = getStartClasspath();

		final ClassLoader loader = ClassLoaderFinder.findClassLoader();
		try {
			final DynamicURLClassLoader dLoader = (DynamicURLClassLoader) loader;
			iterator = new FilteringIterator(Arrays.asList(dLoader.getURLs()).iterator());
		} catch (ClassCastException exception1) {
			if (ClasspathUtil.class.getClassLoader() != loader) {
				try {
					try (URLClassLoader dLoader = (URLClassLoader) loader) {
						iterator = new IteratorIterator(
								new FilteringIterator(Arrays.asList(dLoader.getURLs()).iterator()),
								iterator);
					}
				} catch (ClassCastException | IOException exception2) {
					//
				}
			}
		}

		return iterator;
	}
692828
public static URL getResourceUrl(String resource, Class<?> baseClass) {
		return ResourceUtil.getResource(resource, baseClass);
	}
16326
public static String getClassPath(boolean isEncoded) {
		final URL classPathURL = getClassPathURL();
		String url = isEncoded ? classPathURL.getPath() : URLUtil.getDecodedPath(classPathURL);
		return FileUtil.normalize(url);
	}
852415
def base_path(self):
        
        path = UrlPath()

        # Walk up the API to find the base object
        parent = self.parent
        while parent:
            path_prefix = getattr(parent, 'path_prefix', NoPath)
            path = path_prefix + path
            parent = getattr(parent, 'parent', None)

        return path
220821
public static String findCodeBaseInClassPath(@Nonnull String codeBaseName, String classPath) {
        if (classPath == null) {
            return null;
        }

        StringTokenizer tok = new StringTokenizer(classPath, File.pathSeparator);
        while (tok.hasMoreTokens()) {
            String t = tok.nextToken();
            File f = new File(t);
            if (f.getName().equals(codeBaseName)) {
                return t;
            }
        }

        return null;
    }
855599
public URL getResource(final String name) {
		final String normalizedName = Path.normalizeResourcePath(rootPath
				+ (name.startsWith("/") ? "" : "/") + name).trim();

		log.debug("Searching bundle " + bundle
						+ " for resource [{}], normalized to [{}]", name,
				normalizedName);

		URL url = resourceCache.get(normalizedName);

		if (url == null && !normalizedName.isEmpty()) {
			url = bundle.getEntry(normalizedName);
			if (url == null) {
				log.debug("getEntry failed, trying with /META-INF/resources/ in bundle class space");
				// Search attached bundles for web-fragments
				Set<Bundle> bundlesInClassSpace = ClassPathUtil.getBundlesInClassSpace(bundle, new HashSet<>());
				for (Bundle bundleInClassSpace : bundlesInClassSpace) {
					url = bundleInClassSpace.getEntry("/META-INF/resources/" + normalizedName);
					if (url != null) {
						break;
					}
				}
			}
			// obviously still not found might be available from a attached bundle resource
			if (url == null) {
				log.debug("getEntry failed, fallback to getResource");
				url = bundle.getResource(normalizedName);
			}
			if (url == null) {
				url = NO_URL;
			}
			resourceCache.putIfAbsent(normalizedName, url);
		}

		if (url != null && url != NO_URL) {
			log.debug("Resource found as url [{}]", url);
		} else {
			log.debug("Resource not found");
			url = null;
		}
		return url;
	}
978788
public static String getCurrentClasspath() {
		final StringBuilder path = new StringBuilder();
		for (final URL url : getCurrentClassLoader().getURLs()) {
			if (path.length() > 0) {
				path.append(File.pathSeparator);
			}
			final File file = FileSystem.convertURLToFile(url);
			if (file != null) {
				path.append(file.getAbsolutePath());
			}
		}
		return path.toString();
	}
282859
@Override
	public String getApplicationPath() {
		return request.getScheme() + "://" + request.getServerName()
			+ (request.getServerPort() != 80? ":" + request.getServerPort() : "")
			+ request.getContextPath();
	}
699674
@VisibleForTesting
    URI getBaseDir() {
        URI baseDir = job.getInputDir();

        final Collection<FileInfo> fis = job.getFileInfo();
        for (final FileInfo fi : fis) {
            final URI res = fi.result.resolve(".");
            baseDir = Optional.ofNullable(getCommonBase(baseDir, res)).orElse(baseDir);
        }

        return baseDir;
    }
160948
public String getBaseClassName() {
        CodeGeneratorLoggerFactory.getLogger().debug(
                String.format("Reading base class name from data file [%s]", fileName));
        String baseClass = reader.getBaseClassName();
        if (baseClass == null) {
            String path = new File(fileName).getAbsolutePath();
            throw new IllegalArgumentException("Missing base class details in Data file :" + path);
        }
        return baseClass;
    }
336158
private URI getBaseURI(URI configKey) throws URISyntaxException {
    return new URI(configKey.getScheme(), configKey.getAuthority(), null, configKey.getQuery(), configKey.getFragment());
  }
441229
public static String getClassPath(Class clazz){
        CodeSource codeSource = clazz.getProtectionDomain().getCodeSource();
        if(codeSource!=null)
            return URLUtil.toSystemID(codeSource.getLocation());
        else{
            URL url = clazz.getResource(clazz.getSimpleName() + ".class");
            if("jar".equals(url.getProtocol())){
                String path = url.getPath();
                try{
                    return URLUtil.toSystemID(new URL(path.substring(0, path.lastIndexOf('!'))));
                }catch(MalformedURLException ex){
                    throw new ImpossibleException("as per JAR URL Syntax this should never happen", ex);
                }
            }
            String resource = URLUtil.toSystemID(url);
            String relativePath = "/"+clazz.getName().replace(".", FileUtil.SEPARATOR)+".class";
            if(resource.endsWith(relativePath))
                resource = resource.substring(0, resource.length()-relativePath.length());
            return resource;
        }
    }
1101369
public String getRelativePath() {
    StringBuilder sb = new StringBuilder();
    String pkg = typeRef.getPackageName().replace('.', '/');
    if (pkg.length() > 0) {
      sb.append(pkg);
      sb.append('/');
    }
    appendDeclaringTypes(typeRef, '$', sb);
    sb.append(typeRef.getSimpleName());
    sb.append(".class");
    return sb.toString();
  }