1 package com.bradmcevoy.http;
2
3 import java.io.OutputStream;
4
5 /**
6 * Represents an item which has been uploaded in a form POST
7 *
8 * @author brad
9 */
10 public interface FileItem {
11
12 String getContentType();
13
14 /**
15 * The name of the field which declared the file control
16 * @return
17 */
18 String getFieldName();
19
20 /**
21 * To read the uploaded file
22 *
23 * @return
24 */
25 java.io.InputStream getInputStream();
26
27 /**
28 * The name of the uploaded file
29 * @return
30 */
31 java.lang.String getName();
32
33 /**
34 * The size of the uploaded file
35 * @return
36 */
37 long getSize();
38
39 /**
40 * To allow writing to the uploaded file. Not always supported
41 * @return
42 */
43 OutputStream getOutputStream();
44 }