framework/oryx-common/src/main/java/com/cloudera/oryx/common/settings/ConfigUtils.java
public static void set(Map<String,Object> overlay, String key, Path path) throws IOException {
    Path finalPath = Files.exists(path, LinkOption.NOFOLLOW_LINKS) ?
        path.toRealPath(LinkOption.NOFOLLOW_LINKS) :
        path;
    overlay.put(key, "\"" + finalPath.toUri() + "\"");
  }
public static void set(Map<String,Object> overlay, String key, Path path) throws IOException {
    Path finalPath = Files.exists(path, LinkOption.NOFOLLOW_LINKS) ?
        path.toRealPath(LinkOption.NOFOLLOW_LINKS) :
        path;
    overlay.put(key, "\"" + finalPath.toUri() + "\"");
  }
Helper to set a {@link Path} value correctly for use with {@link #overlayOn(Map,Config)}.

@param overlay key-value pairs to overlay on a {@link Config}
@param key key to set
@param path {@link Path} value
@throws IOException if {@link Path} can't be made canonical