1 31 32 package org.opencms.mail; 33 34 import java.io.ByteArrayOutputStream ; 35 import java.io.IOException ; 36 import java.io.InputStream ; 37 import java.io.OutputStream ; 38 39 import javax.activation.DataSource ; 40 41 56 public class CmsInputStreamDataSource implements DataSource { 57 58 59 private String m_contentType; 60 61 62 private InputStream m_inputStream; 63 64 65 private String m_name; 66 67 93 public CmsInputStreamDataSource(InputStream in, String contentType, String name) { 94 95 m_inputStream = in; 96 m_contentType = contentType; 97 m_name = name; 98 } 99 100 103 public String getContentType() { 104 105 return m_contentType; 106 } 107 108 118 public InputStream getInputStream() throws IOException { 119 120 m_inputStream.reset(); 121 return m_inputStream; 122 } 123 124 127 public String getName() { 128 129 return m_name; 130 } 131 132 141 public OutputStream getOutputStream() { 142 143 return new ByteArrayOutputStream (); 145 } 146 147 } 148 | Popular Tags |