1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.soap.axiom;
18
19 import java.io.IOException;
20 import java.io.InputStream;
21 import javax.activation.DataHandler;
22
23 import org.springframework.util.Assert;
24 import org.springframework.ws.mime.Attachment;
25
26
27
28
29
30
31
32 class AxiomAttachment implements Attachment {
33
34 private final DataHandler dataHandler;
35
36 private final String contentId;
37
38 public AxiomAttachment(String contentId, DataHandler dataHandler) {
39 Assert.notNull(contentId, "contentId must not be null");
40 Assert.notNull(dataHandler, "dataHandler must not be null");
41 this.contentId = contentId;
42 this.dataHandler = dataHandler;
43 }
44
45 public String getContentId() {
46 return contentId;
47 }
48
49 public String getContentType() {
50 return dataHandler.getContentType();
51 }
52
53 public InputStream getInputStream() throws IOException {
54 return dataHandler.getInputStream();
55 }
56
57 public long getSize() {
58
59 return -1;
60 }
61
62 public DataHandler getDataHandler() {
63 return dataHandler;
64 }
65 }