public static String checkPathEnding(String path){
  path.replace('\\','/');
  if (path.endsWith("/"))   return path;
 else   return path + "/";
}

public static String checkPathEnding ( String path ) { path . replace ( '\\' , '/' ) ; if ( path . endsWith ( "/" ) ) return path ; else return path + "/" ; }
makes sure that a path ends with " / "
