001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE 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 Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: */
019:
020: package de.schlund.pfixxml.multipart;
021:
022: import java.io.File;
023: import java.util.Date;
024:
025: import de.schlund.pfixxml.RequestParamType;
026:
027: /**
028: *
029: *
030: */
031:
032: public class FileData extends PartData implements UploadFile {
033:
034: private String transferEncoding = null;
035: private String filename = null;
036: private Date modificationDate = null;
037: private Date readDate = null;
038: private long size = 0;
039: private String localFilename = null;
040: private File localFile = null;
041: private boolean exceedsSizeLimit;
042:
043: /**
044: * Constructor for FileData.
045: */
046: public FileData() {
047: super ();
048: setType(RequestParamType.FILEDATA);
049: }
050:
051: public boolean isTrue() {
052: return false;
053: }
054:
055: /**
056: * Gets the filename.
057: * @return Returns a String
058: */
059: public String getFilename() {
060: return filename;
061: }
062:
063: public String getName() {
064: return filename;
065: }
066:
067: /**
068: * Sets the filename.
069: * @param filename The filename to set
070: */
071: public void setFilename(String filename) {
072: this .filename = filename;
073: }
074:
075: /**
076: * Gets the localFilename.
077: * @return Returns a String
078: */
079: public String getLocalFilename() {
080: return localFilename;
081: }
082:
083: /**
084: * Sets the localFilename.
085: * @param localFilename The localFilename to set
086: */
087: public void setLocalFilename(String localFilename) {
088: this .localFilename = localFilename;
089: }
090:
091: /**
092: * Gets the size.
093: * @return Returns a long
094: */
095: public long getSize() {
096: return size;
097: }
098:
099: /**
100: * Sets the size.
101: * @param size The size to set
102: */
103: public void setSize(long size) {
104: this .size = size;
105: }
106:
107: /**
108: * Gets the transferEncoding.
109: * @return Returns a String
110: */
111: public String getTransferEncoding() {
112: return transferEncoding;
113: }
114:
115: /**
116: * Sets the transferEncoding.
117: * @param transferEncoding The transferEncoding to set
118: */
119: public void setTransferEncoding(String transferEncoding) {
120: this .transferEncoding = transferEncoding;
121: }
122:
123: /**
124: * Gets the modificationDate.
125: * @return Returns a Date
126: */
127: public Date getModificationDate() {
128: return modificationDate;
129: }
130:
131: /**
132: * Sets the modificationDate.
133: * @param modificationDate The modificationDate to set
134: */
135: public void setModificationDate(Date modificationDate) {
136: this .modificationDate = modificationDate;
137: }
138:
139: /**
140: * Gets the readDate.
141: * @return Returns a Date
142: */
143: public Date getReadDate() {
144: return readDate;
145: }
146:
147: /**
148: * Sets the readDate.
149: * @param readDate The readDate to set
150: */
151: public void setReadDate(Date readDate) {
152: this .readDate = readDate;
153: }
154:
155: public void setValue(String val) {
156: localFilename = val;
157: }
158:
159: public String getValue() {
160: return localFilename;
161: }
162:
163: /**
164: * Gets the localFile.
165: * @return Returns a File
166: */
167: public File getLocalFile() {
168: return localFile;
169: }
170:
171: /**
172: * Sets the localFile.
173: * @param localFile The localFile to set
174: */
175: public void setLocalFile(File localFile) {
176: this .localFile = localFile;
177: }
178:
179: public boolean exceedsSizeLimit() {
180: return exceedsSizeLimit;
181: }
182:
183: public void setExceedsSizeLimit(boolean exceedsSizeLimit) {
184: this .exceedsSizeLimit = exceedsSizeLimit;
185: }
186:
187: public String getMimeType() {
188: return primaryType + "/" + subType;
189: }
190:
191: }
|