• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with ByteArrayDataSource...  RSS feed

 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This class doesn't seem to exist... I am trying to send an HTML email message, and the example states the folloowing:
msg.setDataHandler(new DataHandler( new ByteArrayDataSource(text.toString,"text/html") ) )
Everything is fine except that class ByteArrayDataSource is not anywhere to be found! It's not in 1.4.2's API, it's not in javax.mail API... where the hell is it? There's some classes with the same name out on the web, but I don't know if I can trust them...
What the hell is wrong? Didn't the folks at sun notice that they are using non-existant classes in their product?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That sounds like a implementation of the DataSource interface in the javax.activation package - which is what DataHandler is expecting. Where did you get that source code?
Since we have ByteArrayOutputStream in java.io, you should be able to make a ByteArrayDataSource based on that. I think that all the DataHandler needs in an InputStream to get the content from.
Bill
 
Ivan Jouikov
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
download java mail, look in demo folder at sendhtml.java...
I can't believe developers would release source code with non-existant classes...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!