code: public static Attachment fromTextFile( File file, MediaType mediaType ) throws IOException {
          return fromText( Files.toString( file, mediaType.getCharset() ), mediaType );
      }
docs: Creates a non-binary attachment from the given file.
  @throws IOException if an I/O error occurs
  @throws java.lang.IllegalArgumentException if mediaType is either binary or has no specified charset