1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 }