001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.html.events;
021:
022: /////////////////////////
023: //$Archive: /SOFIA/SourceCode/com/salmonllc/html/events/FileUploadEvent.java $
024: //$Author: Srufle $
025: //$Revision: 10 $
026: //$Modtime: 4/15/03 1:55a $
027: /////////////////////////
028:
029: import com.salmonllc.html.HtmlComponent;
030: import com.salmonllc.html.HtmlPage;
031:
032: /**
033: * This object will be created and passed to every file upload event method.
034: * @see FileUploadListener
035: */
036:
037: public class FileUploadEvent {
038: HtmlPage _page;
039: HtmlComponent _comp;
040: String _name;
041: String _fullName;
042: byte[] _content;
043: String _fileName;
044: String _shortFileName;
045: String _mimeType;
046: int _row;
047:
048: public FileUploadEvent(HtmlPage page, HtmlComponent comp,
049: String name, String fullName, String fileName,
050: byte[] content, String mimeType, int row) {
051: this (page, comp, name, fullName, fileName, null, content,
052: mimeType, row);
053: }
054:
055: public FileUploadEvent(HtmlPage page, HtmlComponent comp,
056: String name, String fullName, String fileName,
057: String shortFileName, byte[] content, String mimeType,
058: int row) {
059: _page = page;
060: _comp = comp;
061: _name = name;
062: _fullName = fullName;
063: _content = content;
064: _fileName = fileName;
065: _mimeType = mimeType;
066: _row = row;
067: _shortFileName = shortFileName;
068: }
069:
070: /**
071: * This method returns the component that sumbitted the page.
072: */
073: public HtmlComponent getComponent() {
074: return _comp;
075: }
076:
077: /**
078: * This method returns the content for the file uploaded
079: */
080: public byte[] getContent() {
081: return _content;
082: }
083:
084: /**
085: * This method returns the name of the file that was uploaded
086: */
087: public String getFileName() {
088: return _fileName;
089: }
090:
091: /**
092: * This method returns the short name of the file that was uploaded
093: */
094: public String getShortFileName() {
095: return _shortFileName;
096: }
097:
098: /**
099: * This method returns the full name (name of component appended to the name of its containers) of the component that submitted the page.
100: */
101: public String getFullName() {
102: return _fullName;
103: }
104:
105: /**
106: * This method returns the mime type of the file that was uploaded.
107: */
108: public String getMimeType() {
109: return _mimeType;
110: }
111:
112: /**
113: * This method returns the name of the component that submitted the page.
114: */
115: public String getName() {
116: return _name;
117: }
118:
119: /**
120: * This method returns the page for which the submit was performed.
121: */
122: public HtmlPage getPage() {
123: return _page;
124: }
125:
126: /**
127: * This method returns the row for which the submit was performed.
128: */
129: public int getRow() {
130: return _row;
131: }
132: }
|