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