List of usage examples for org.apache.hadoop.registry.client.binding RegistryUtils homePathForCurrentUser
public static String homePathForCurrentUser()
From source file:org.apache.slider.core.registry.SliderRegistryUtils.java
License:Apache License
/** * Process a path expanding it if needed. * Validation is delegated to later as the core registry will need * to do that anyway/*from www .j ava 2 s .com*/ * @param path path * @return a path maybe with some expansion */ public static String resolvePath(String path) { Preconditions.checkArgument(path != null, "null path"); Preconditions.checkArgument(!path.isEmpty(), "empty path"); String newpath = path; if (path.startsWith("~/")) { // add user expansion newpath = RegistryUtils.homePathForCurrentUser() + path.substring(1); } else if (path.equals("~")) { newpath = RegistryUtils.homePathForCurrentUser(); } return newpath; }