public static String normalizeDir(String path){
  return (path != null && (!(path.endsWith("/") || path.endsWith("\\")))) ? path + File.separator : path;
}

public static String normalizeDir ( String path ) { return ( path != null && ( ! ( path . endsWith ( "/" ) || path . endsWith ( "\\" ) ) ) ) ? path + File . separator : path ; }
ensures a directory name always ends with a ' / ' .
