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 {
24 this.part = part;
25 }
26
27 public InputStream getInputStream() throws IOException
28 {
29 return part.getInputStream();
30 }
31
32 public OutputStream getOutputStream() throws IOException
33 {
34 throw new UnsupportedOperationException("getOutputStream");
35 }
36
37 public String getContentType()
38 {
39 return part.getContentType();
40 }
41
42 public String getName()
43 {
44 return part.getName();
45 }
46
47 public Part getPart()
48 {
49 return part;
50 }
51 }