1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.http.multipart;
17
18 import io.netty.buffer.ByteBuf;
19
20 import java.nio.charset.Charset;
21
22
23
24
25 public class MixedFileUpload extends AbstractMixedHttpData<FileUpload> implements FileUpload {
26
27 public MixedFileUpload(String name, String filename, String contentType,
28 String contentTransferEncoding, Charset charset, long size,
29 long limitSize) {
30 this(name, filename, contentType, contentTransferEncoding,
31 charset, size, limitSize, DiskFileUpload.baseDirectory, DiskFileUpload.deleteOnExitTemporaryFile);
32 }
33
34 public MixedFileUpload(String name, String filename, String contentType,
35 String contentTransferEncoding, Charset charset, long size,
36 long limitSize, String baseDir, boolean deleteOnExit) {
37 super(limitSize, baseDir, deleteOnExit,
38 size > limitSize?
39 new DiskFileUpload(name, filename, contentType, contentTransferEncoding, charset, size, baseDir,
40 deleteOnExit) :
41 new MemoryFileUpload(name, filename, contentType, contentTransferEncoding, charset, size)
42 );
43 }
44
45 @Override
46 public String getContentTransferEncoding() {
47 return wrapped.getContentTransferEncoding();
48 }
49
50 @Override
51 public String getFilename() {
52 return wrapped.getFilename();
53 }
54
55 @Override
56 public void setContentTransferEncoding(String contentTransferEncoding) {
57 wrapped.setContentTransferEncoding(contentTransferEncoding);
58 }
59
60 @Override
61 public void setFilename(String filename) {
62 wrapped.setFilename(filename);
63 }
64
65 @Override
66 public void setContentType(String contentType) {
67 wrapped.setContentType(contentType);
68 }
69
70 @Override
71 public String getContentType() {
72 return wrapped.getContentType();
73 }
74
75 @Override
76 FileUpload makeDiskData() {
77 DiskFileUpload diskFileUpload = new DiskFileUpload(
78 getName(), getFilename(), getContentType(), getContentTransferEncoding(), getCharset(), definedLength(),
79 baseDir, deleteOnExit);
80 diskFileUpload.setMaxSize(getMaxSize());
81 return diskFileUpload;
82 }
83
84 @Override
85 public FileUpload copy() {
86
87 return super.copy();
88 }
89
90 @Override
91 public FileUpload duplicate() {
92
93 return super.duplicate();
94 }
95
96 @Override
97 public FileUpload retainedDuplicate() {
98
99 return super.retainedDuplicate();
100 }
101
102 @Override
103 public FileUpload replace(ByteBuf content) {
104
105 return super.replace(content);
106 }
107
108 @Override
109 public FileUpload touch() {
110
111 return super.touch();
112 }
113
114 @Override
115 public FileUpload touch(Object hint) {
116
117 return super.touch(hint);
118 }
119
120 @Override
121 public FileUpload retain() {
122
123 return super.retain();
124 }
125
126 @Override
127 public FileUpload retain(int increment) {
128
129 return super.retain(increment);
130 }
131 }