agave-files/files-core/src/main/java/org/iplantc/service/io/permissions/PermissionManager.java
/**
	 * Cleans up path by normalizing and removing trailing slash. OS safe.
	 * 
	 * @param path any file path
	 * @return Normalized path without trailing slash.
	 */
Cleans up path by normalizing and removing trailing slash. OS safe.

@param path any file path
@return Normalized path without trailing slash.
Cleans up path by normalizing and removing trailing slash . OS safe . @param path any file path @return Normalized path without trailing slash .
private String cleanPath(String path)
	{
		if (StringUtils.isEmpty(path) || StringUtils.equals(path, "/")) {
			return "/";
		}
		String adjustedPath = path;
		if (StringUtils.endsWith(adjustedPath, "/..") || StringUtils.endsWith(adjustedPath, "/.")) {
			adjustedPath += "/";
		}
		if (StringUtils.startsWith(adjustedPath,"/")) {
			adjustedPath = FileUtils.normalize(adjustedPath);
		} else {
			adjustedPath = FilenameUtils.normalize(adjustedPath);
		}
		return adjustedPath;
	}
private String cleanPath ( String path ) { if ( StringUtils . isEmpty ( path ) || StringUtils . equals ( path , "/" ) ) { return "/" ; } String adjustedPath = path ; if ( StringUtils . endsWith ( adjustedPath , "/.." ) || StringUtils . endsWith ( adjustedPath , "/." ) ) { adjustedPath += "/" ; } if ( StringUtils . startsWith ( adjustedPath , "/" ) ) { adjustedPath = FileUtils . normalize ( adjustedPath ) ; } else { adjustedPath = FilenameUtils . normalize ( adjustedPath ) ; } return adjustedPath ; }
Cleans up path by normalizing and removing trailing slash.
Cleans up path by normalizing and removing trailing slash .