1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
package org.mule.transport.http.multipart; |
11 | |
|
12 | |
import java.io.IOException; |
13 | |
import java.io.InputStream; |
14 | |
import java.io.OutputStream; |
15 | |
|
16 | |
import javax.activation.DataSource; |
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
public class PartDataSource implements DataSource |
22 | |
{ |
23 | |
private Part part; |
24 | |
|
25 | |
public PartDataSource(Part part) |
26 | 0 | { |
27 | 0 | this.part = part; |
28 | 0 | } |
29 | |
|
30 | |
public InputStream getInputStream() throws IOException |
31 | |
{ |
32 | 0 | return part.getInputStream(); |
33 | |
} |
34 | |
|
35 | |
public OutputStream getOutputStream() throws IOException |
36 | |
{ |
37 | 0 | throw new UnsupportedOperationException("getOutputStream"); |
38 | |
} |
39 | |
|
40 | |
public String getContentType() |
41 | |
{ |
42 | 0 | return part.getContentType(); |
43 | |
} |
44 | |
|
45 | |
public String getName() |
46 | |
{ |
47 | 0 | return part.getName(); |
48 | |
} |
49 | |
|
50 | |
public Part getPart() |
51 | |
{ |
52 | 0 | return part; |
53 | |
} |
54 | |
} |