public static String URIforPortablePath(String path){
  if (path.startsWith(FileUtil.PREFERENCES)) {
    return path.replaceFirst(FileUtil.PREFERENCES,"/prefs/");
  }
 else   if (path.startsWith(FileUtil.PROGRAM)) {
    return path.replaceFirst(FileUtil.PROGRAM,"/dist/");
  }
 else {
    return null;
  }
}

public static String URIforPortablePath ( String path ) { if ( path . startsWith ( FileUtil . PREFERENCES ) ) { return path . replaceFirst ( FileUtil . PREFERENCES , "/prefs/" ) ; } else if ( path . startsWith ( FileUtil . PROGRAM ) ) { return path . replaceFirst ( FileUtil . PROGRAM , "/dist/" ) ; } else { return null ; } }
get the public uri for a portable path . this method returns public uris for only some portable paths , and does not check that the portable path is actually sane . note that this refuses to return portable paths that are outside of program : and preference :
