KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > activation > DataHandlerDataSource


1 /*
2   GNU-Classpath Extensions: java bean activation framework
3   Copyright (C) 2000 2001 Andrew Selkirk
4
5   For more information on the classpathx please mail:
6   nferrier@tapsellferrier.co.uk
7
8   This program is free software; you can redistribute it and/or
9   modify it under the terms of the GNU Lesser General Public License
10   as published by the Free Software Foundation; either version 2
11   of the License, or (at your option) any later version.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16   GNU General Public License for more details.
17
18   You should have received a copy of the GNU General Public License
19   along with this program; if not, write to the Free Software
20   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */

22 package javax.activation;
23
24 // Imports
25
import java.io.InputStream JavaDoc;
26 import java.io.OutputStream JavaDoc;
27 import java.io.IOException JavaDoc;
28
29 /**
30  * Data handler data source. Use of this class is currently unknown.
31  * @author Andrew Selkirk
32  * @version $Revision: 1.3 $
33  */

34 class DataHandlerDataSource
35 implements DataSource JavaDoc
36 {
37
38   //-------------------------------------------------------------
39
// Variables --------------------------------------------------
40
//-------------------------------------------------------------
41

42   /**
43    * Reference to data handler
44    */

45   DataHandler JavaDoc dataHandler;
46
47
48   //-------------------------------------------------------------
49
// Initialization ---------------------------------------------
50
//-------------------------------------------------------------
51

52   /**
53    * Create new data handler data source.
54    * @param handler Data handler
55    */

56   public DataHandlerDataSource(DataHandler JavaDoc handler)
57   {
58     dataHandler = handler;
59   } // DataHandlerDataSource()
60

61
62   //-------------------------------------------------------------
63
// Public Accessor Methods ------------------------------------
64
//-------------------------------------------------------------
65

66   /**
67    * Get input stream.
68    * @return Input stream
69    * @throws IOException IO exception occurred
70    */

71   public InputStream JavaDoc getInputStream() throws IOException JavaDoc
72   {
73     return dataHandler.getInputStream();
74   } // getInputStream()
75

76   /**
77    * Get output stream.
78    * @return Output stream
79    * @throws IOException IO exception occurred
80    */

81   public OutputStream JavaDoc getOutputStream() throws IOException JavaDoc
82   {
83     return dataHandler.getOutputStream();
84   } // getOutputStream()
85

86   /**
87    * Get content type.
88    * @return Content type
89    */

90   public String JavaDoc getContentType()
91   {
92     return dataHandler.getContentType();
93   } // getContentType()
94

95   /**
96    * Get name.
97    * @return Name
98    */

99   public String JavaDoc getName()
100   {
101     return dataHandler.getName();
102   } // getName()
103

104
105 } // DataHandlerDataSource
106
Popular Tags