|
You have only four methods to implement, like this: getContentType(): return a string containing the MIME type of whatever's in the input stream. You'd have to have some way of setting or determining this. getInputStream(): return the input stream that you passed into the object via its constructor. getName(): probably irrelevant. getOutputStream(): throw an IOException. PC2 -----Original Message----- From: Bruce Jin [mailto:brucej@mrc-productivity.com] Sent: October 5, 2001 12:38 To: java400-l@midrange.com Subject: JavaMail: Implement DataSource in javax.activation package In my java program I need to send some generated contents as e-mail attachment. But I found that the javax.activation only comes with a FileDataSource that implements DataSource. This can be used to send a file: DataSource source = new FileDataSource(filename); How do I implement DataSource so that I have something like InputStreamDataSource then I can send some generated contents in my java program as e-mail attachment?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.