Gets the actual path of a URI relative to the context of
the compilation.
@param path The webapp path
@return the corresponding path in the filesystem
966341
public String getRealPath(String path) {
        if (context != null) {
            return context.getRealPath(path);
        }
        return path;
    }
925745
public String getPath(String base, String uri) throws ResourceNotFoundException, IOException {

		String fileName = uri;
		if (!fileName.endsWith(".scss")) {
			fileName += ".scss";
		}

		String parentPath = base.replace('\\', '/');
		fileName = fileName.replace('\\', '/');

		return PathNormalizer.concatWebPath(parentPath, fileName);
	}
1229205
public static URI appendPathOrDie(URI base, String path) {
    try {
      return appendPath(base, path);
    } catch (URISyntaxException e) {
      throw new RuntimeException(e);
    }
  }
957747
private String getBaseRepoPath(final String path) {
        int pos;
        if (path.contains("local-repo")) {
            pos = path.indexOf("local-repo" + File.separator) + 11;
        } else {
            pos = path.indexOf("repository" + File.separator) + 11;
        }
        if (pos < 0) {
            return path;
        }
        int tmp = path.indexOf(File.separator, pos);
        if (tmp <= 0) {
            return path;
        }
        //below is always true
        //if (tmp > 0) {
        pos = tmp + 1;
        //}
        tmp = path.indexOf(File.separator, pos);
        if (tmp > 0) {
            pos = tmp + 1;
        }
        return path.substring(0, pos);
    }
147510
public String getFullPath(String path) {

		if (StringUtils.isEmpty(pathPrefix)) {
			return path;
		}

		return PathNormalizer.asPath(pathPrefix + path);
	}
1230859
private Path relativePath(final Path path) {
		List<Path> pathList = new ArrayList<>();
		for (Path part : path) {
			pathList.add(part);
		}

		int loadPathSize = this.loadPathParts.length;

		// loadPathのフォルダの並びと一致する場所を特定し、その下を相対パスとして返却する
		for (int i = 0; i < pathList.size() - loadPathSize; i++) {
			String[] paths = pathList.subList(i, i + loadPathSize).stream().map(Path::toString)
					.collect(Collectors.toList()).toArray(new String[loadPathSize]);
			if (Arrays.equals(this.loadPathParts, paths)) {
				return path.subpath(i + loadPathSize, path.getNameCount());
			}
		}
		// loadPathと一致しなかった場合は元のpathを返却する
		return path;
	}
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;
    }
25212
public static String applySpecialPaths(String path) throws IllegalArgumentException {
        List<String> tokens = getTokens(path);
        if (tokens == null) { return null; }
        int i = 0;
        for (int j = 0; j < tokens.size(); j++) {
            String token = tokens.get(j);
            if (isCurrentToken(token)) { continue; } else if (isReverseToken(token)) { i--; } else { tokens.set(i++, token); }
            if (i < 0) {
                throw VFSMessages.MESSAGES.onRootPath();
            }
        }
        return getRemainingPath(tokens, 0, i);
    }
527728
public HttpMessage path(final String path) {
        header(HttpMessageHeaders.HTTP_REQUEST_URI, path);
        header(DynamicEndpointUriResolver.REQUEST_PATH_HEADER_NAME, path);
        return this;
    }
663908
private static String getWellFormPath(String path) {
		if(null != path){
			//去掉项目名部分，不去开头的"/"
			final String contextPath = ActionContext.getContextPath();
			if(null != contextPath && false == StrUtil.SLASH.equals(contextPath)){
				path = StrUtil.removePrefix(path, contextPath);
			}
			
			//去掉尾部"/"，如果path为"/"不处理
			if(path.length() > 1) {
				path = StrUtil.removeSuffix(path, StrUtil.SLASH);
			}
		}
		return path;
	}
176511
private String resolveRemotePath(String path) throws SftpStatusException {
		verifyConnection();

		String actual;
		if (!path.startsWith("/") && !path.startsWith(cwd)
				&& !isWindowsRoot(path) && !startsWithCustomRoot(path)) {
			actual = cwd + (cwd.endsWith("/") ? "" : "/") + path;
		} else {
			actual = path;
		}

		if (!actual.equals("/") && actual.endsWith("/")) {
			return actual.substring(0, actual.length() - 1);
		} else {
			return actual;
		}
	}
374195
public StringPath get(StringPath path) {
        StringPath newPath = getString(toString(path));
        return addMetadataOf(newPath, path);
    }
1243658
public URI toUri(JimfsPath path) {
    fileStore.state().checkOpen();
    return pathService.toUri(uri, path.toAbsolutePath());
  }
1239604
public Optional<URL> getResource(String path) {
        boolean isDirectory = isDirectory(path);

        if (!isDirectory) {
            URL url = classLoader.getResource(prefixPath(path));
            return Optional.ofNullable(url);
        }
        return Optional.empty();
    }
934860
public Resource[] getResources(String path) throws IOException {
        if (hasContext()) {
            return context.getResources(path);
        }
        return getContext().getResources(getContextPath() + '/' + path);
    }
931264
public static String getParentPath(final String path) {
    final int pos = path.lastIndexOf(File.separator);
    if (pos <= 0) {
      return null;
    }
    return path.substring(0, pos);
  }
612401
public static String getAbsolutePath(String path, Class<?> baseClass) {
		String normalPath;
		if (path == null) {
			normalPath = StrUtil.EMPTY;
		} else {
			normalPath = normalize(path);
			if (isAbsolutePath(normalPath)) {
				// 给定的路径已经是绝对路径了
				return normalPath;
			}
		}

		// 相对于ClassPath路径
		final URL url = ResourceUtil.getResource(normalPath, baseClass);
		if (null != url) {
			// 对于jar中文件包含file:前缀，需要去掉此类前缀，在此做标准化，since 3.0.8 解决中文或空格路径被编码的问题
			return FileUtil.normalize(URLUtil.getDecodedPath(url));
		}

		// 如果资源不存在，则返回一个拼接的资源绝对路径
		final String classPath = ClassUtil.getClassPath();
		if (null == classPath) {
			// throw new NullPointerException("ClassPath is null !");
			// 在jar运行模式中，ClassPath有可能获取不到，此时返回原始相对路径（此时获取的文件为相对工作目录）
			return path;
		}

		// 资源不存在的情况下使用标准化路径有问题，使用原始路径拼接后标准化路径
		return normalize(classPath.concat(path));
	}