public static String requestPath(URL url){
  String fileOnly=url.getFile();
  if (fileOnly == null) {
    return "/";
  }
 else   if (!fileOnly.startsWith("/")) {
    return "/" + fileOnly;
  }
 else {
    return fileOnly;
  }
}

public static String requestPath ( URL url ) { String fileOnly = url . getFile ( ) ; if ( fileOnly == null ) { return "/" ; } else if ( ! fileOnly . startsWith ( "/" ) ) { return "/" + fileOnly ; } else { return fileOnly ; } }
returns the path to request , like the ' / ' in ' get / http / 1 . 1 ' . never empty , even if the request url is . includes the query component if it exists .
