001: /* *************************************************************************
002:
003: Millstone(TM)
004: Open Sourced User Interface Library for
005: Internet Development with Java
006:
007: Millstone is a registered trademark of IT Mill Ltd
008: Copyright (C) 2000-2005 IT Mill Ltd
009:
010: *************************************************************************
011:
012: This library is free software; you can redistribute it and/or
013: modify it under the terms of the GNU Lesser General Public
014: license version 2.1 as published by the Free Software Foundation.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: *************************************************************************
026:
027: For more information, contact:
028:
029: IT Mill Ltd phone: +358 2 4802 7180
030: Ruukinkatu 2-4 fax: +358 2 4802 7181
031: 20540, Turku email: info@itmill.com
032: Finland company www: www.itmill.com
033:
034: Primary source for MillStone information and releases: www.millstone.org
035:
036: ********************************************************************** */
037:
038: package org.millstone.webadapter;
039:
040: import java.io.InputStream;
041:
042: /** WebAdapter implementation of the UploadStream interface.
043: *
044: * @author IT Mill Ltd.
045: * @version 3.1.1
046: * @since 3.0
047: */
048: public class HttpUploadStream implements
049: org.millstone.base.terminal.UploadStream {
050:
051: /** Holds value of property variableName. */
052: private String streamName;
053: private String contentName;
054: private String contentType;
055:
056: /** Holds value of property variableValue. */
057: private InputStream stream;
058:
059: /** Creates a new instance of UploadStreamImpl
060: * @param name of the stream
061: * @param stream input stream
062: * @param contentName name of the content
063: * @param contentType type of the content
064: * @param time Time of event creation
065: * (for parallel events (for example in
066: * same http request), times are equal)
067: */
068: public HttpUploadStream(String name, InputStream stream,
069: String contentName, String contentType) {
070: this .streamName = name;
071: this .stream = stream;
072: this .contentName = contentName;
073: this .contentType = contentType;
074: }
075:
076: /** Get the name of the stream.
077: * @return name of the stream.
078: */
079: public String getStreamName() {
080: return this .streamName;
081: }
082:
083: /** Get input stream.
084: * @return Input stream.
085: */
086: public InputStream getStream() {
087: return this .stream;
088: }
089:
090: /** Get input stream content type.
091: * @return content type of the input stream.
092: */
093: public String getContentType() {
094: return this .contentType;
095: }
096:
097: /** Get stream content name.
098: * Stream content name usually differs from the actual stream name.
099: * it is used toi identify the content of the stream.
100: * @return Name of the stream content.
101: */
102: public String getContentName() {
103: return this.contentName;
104: }
105: }
|