What is a FileDataSource?
Location: http://www.jguru.com/faq/view.jsp?EID=237612 Created: Oct 26, 2000 Modified: 2000-10-26 10:08:07.138 Author: John Zukowski (http://www.jguru.com/guru/viewbio.jsp?EID=7) Question originally posed by Chandra Prasad Reddy (http://www.jguru.com/guru/viewbio.jsp?EID=231859 A FileDataSource is part of the JavaBeans Activation Framework, package javax.activation. It represents a DataSource associated with a file, that relies on a FileTypeMap to associate mime types with file extensions. They can be used to send file attachments: MimeBodyPart messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(fileAttachment); messageBodyPart.setDataHandler( new DataHandler(source)); messageBodyPart.setFileName( filenameString); The other type of predefined DataSource in the Activation Framework is the URLDataSource.