public static String makeLink(FileDescriptor fd,boolean newWindow,boolean attachment){
  StringBuilder sb=new StringBuilder();
  sb.append("<a href=\"");
  sb.append(makeUrl(fd,attachment));
  sb.append("\"");
  if (newWindow)   sb.append(" target=\"_blank\"");
  sb.append(">");
  sb.append(fd.getName());
  sb.append("</a>");
  return sb.toString();
}

public static String makeLink ( FileDescriptor fd , boolean newWindow , boolean attachment ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<a href=\"" ) ; sb . append ( makeUrl ( fd , attachment ) ) ; sb . append ( "\"" ) ; if ( newWindow ) sb . append ( " target=\"_blank\"" ) ; sb . append ( ">" ) ; sb . append ( fd . getName ( ) ) ; sb . append ( "</a>" ) ; return sb . toString ( ) ; }
creates html link for downloading a file .
