private static String replaceTildeWithHomeDir(String path) {
        if (path.startsWith("~/"))
            return System.getProperty("user.home") + path.substring(1);
        return path;
    }
private static String replaceTildeWithHomeDir ( String path ) { if ( path . startsWith ( "~/" ) ) return System . getProperty ( "user.home" ) + path . substring ( 1 ) ; return path ; }
Utility for resolving paths on unix systems that contain tilda for
the home directory.

@param path the file system path
@return normalised path