public static boolean isAttachment(String contentDisposition){
  return contentDisposition != null && contentDisposition.regionMatches(true,0,"attachment",0,10);
}

public static boolean isAttachment ( String contentDisposition ) { return contentDisposition != null && contentDisposition . regionMatches ( true , 0 , "attachment" , 0 , 10 ) ; }
returns true if the download meant to be treated as an attachment .
