View Javadoc

1   /*
2    * Copyright 2004-2005 Emmanouil Batsis
3    * 
4    * Licensed under the GNU General Public License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.gnu.org/licenses/gpl.txt
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   * 
16   */
17  package com.geekologue.md4j.dto;
18  
19  import java.io.InputStream;
20  
21  /***
22   * Bundle of a file and information for it in a single object usefull for data
23   * transfer. Used as a DTO in web to business communication instead of framework specific classes (e.g. Struts' FormFile)
24   * 
25   * @author manos
26   * 
27   */
28  public class File {
29      /***
30       * Default constructor
31       * 
32       */
33      public File() {
34      }
35  
36      /***
37       * The content type of this file
38       */
39      private String      contentType;
40  
41      /***
42       * The name of this file
43       */
44      private String      fileName;
45  
46      /***
47       * The size of this file
48       */
49      private int         fileSize;
50  
51      /***
52       * The inputstream of this file
53       */
54      private InputStream inputStream;
55  
56      /***
57       * @return Returns the contentType.
58       */
59      public final String getContentType() {
60          return contentType;
61      }
62  
63      /***
64       * @param contentType
65       *            The contentType to set.
66       */
67      public final void setContentType(String contentType) {
68          this.contentType = contentType;
69      }
70  
71      /***
72       * @return Returns the fileName.
73       */
74      public final String getFileName() {
75          return fileName;
76      }
77  
78      /***
79       * @param fileName
80       *            The fileName to set.
81       */
82      public final void setFileName(String fileName) {
83          this.fileName = fileName;
84      }
85  
86      /***
87       * @return Returns the fileSize.
88       */
89      public final int getFileSize() {
90          return fileSize;
91      }
92  
93      /***
94       * @param fileSize
95       *            The fileSize to set.
96       */
97      public final void setFileSize(int fileSize) {
98          this.fileSize = fileSize;
99      }
100 
101     /***
102      * @return Returns the inputStream.
103      */
104     public final InputStream getInputStream() {
105         return inputStream;
106     }
107 
108     /***
109      * @param inputStream
110      *            The inputStream to set.
111      */
112     public final void setInputStream(InputStream inputStream) {
113         this.inputStream = inputStream;
114     }
115 }