public long contentLength(){
  long size;
  try {
    size=Long.parseLong(request.getHeader(FileUpload.CONTENT_LENGTH));
  }
 catch (  NumberFormatException e) {
    size=request.getContentLength();
  }
  return size;
}

public long contentLength ( ) { long size ; try { size = Long . parseLong ( request . getHeader ( FileUpload . CONTENT_LENGTH ) ) ; } catch ( NumberFormatException e ) { size = request . getContentLength ( ) ; } return size ; }
retrieve the content length of the request .
