1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.xdbserver.xql;
12
13 import java.io.File;
14 import java.io.FileInputStream;
15 import java.io.IOException;
16 import java.io.InputStream;
17 import org.astrogrid.dataservice.queriers.Querier;
18 import org.astrogrid.dataservice.queriers.RawPipeResults;
19 import org.astrogrid.slinger.mime.MimeTypes;
20
21 /***
22 * A results wrapper around an XML document stream
23 *
24 */
25 public class XmlResults extends RawPipeResults {
26
27 /*** Std Constructor. xmlIn is a stream containing the xml document
28 */
29 public XmlResults(Querier querier, InputStream xmlIn) {
30 super(querier, xmlIn, MimeTypes.XML);
31 }
32
33 /*** Constructor where the xml doc is in the given File
34 */
35 public XmlResults(Querier querier, File xmlFile) throws IOException {
36 this(querier, new FileInputStream(xmlFile));
37 }
38
39 public static String[] listFormats() {
40 return new String[] { MimeTypes.XML };
41 }
42
43 }
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61