Java Code Examples for com.google.common.io.Files#simplifyPath()

The following examples show how to use com.google.common.io.Files#simplifyPath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleUrl.java    From james-project with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
static String simplifyPath(String path) {
    String simplified = Files.simplifyPath(path);
    if (CURRENT_PATH.equals(simplified)) {
        return "";
    }
    return simplified;
}
 
Example 2
Source File: AbstractTftpDataProvider.java    From tftp4j with Apache License 2.0 5 votes vote down vote up
@CheckForNull
protected String toPath(@Nonnull String prefix, @Nonnull String path) {
    path = Files.simplifyPath(path);
    if (!path.startsWith("/")) {
        LOG.error("Not absolute: " + path);
        return null;
    }
    return prefix + path;
}
 
Example 3
Source File: FilePathUtil.java    From vjtools with Apache License 2.0 4 votes vote down vote up
/**
 * 将路径整理,如 "a/../b",整理成 "b"
 */
public static String simplifyPath(String path) {
	return Files.simplifyPath(path);
}
 
Example 4
Source File: FilePathUtil.java    From vjtools with Apache License 2.0 4 votes vote down vote up
/**
 * 将路径整理,如 "a/../b",整理成 "b"
 */
public static String simplifyPath(String path) {
	return Files.simplifyPath(path);
}
 
Example 5
Source File: FilePathUtil.java    From j360-dubbo-app-all with Apache License 2.0 4 votes vote down vote up
/**
 * 将路径整理,如 "a/../b",整理成 "b"
 */
public static String simplifyPath(String path) {
	return Files.simplifyPath(path);
}
 
Example 6
Source File: ResourcePath.java    From purplejs with Apache License 2.0 4 votes vote down vote up
private static String normalizePath( final String path )
{
    return Files.simplifyPath( SEP + path );
}