1
2
3
4
5
6
7 package org.astrogrid.tableserver.out;
8
9 import java.io.IOException;
10 import java.security.Principal;
11 import org.astrogrid.slinger.targets.TargetIdentifier;
12 import org.astrogrid.tableserver.metadata.ColumnInfo;
13
14 /***
15 * For writing out fits wrapped in votable
16 *
17 * @author M Hill
18 */
19
20 public class VoTableFitsWriter extends VoTableWriter {
21
22
23 /***
24 * Construct this wrapping the given stream. Writes out the first few tags
25 */
26 public VoTableFitsWriter(TargetIdentifier target, String title, Principal user) throws IOException {
27 super(target, title, user);
28
29 }
30
31 /*** Start body - writes out header and preps col array */
32 public void startTable(ColumnInfo[] cols) throws IOException {
33 }
34
35 /*** Actually writes out a table. Assumes only 1 element in given colValues,
36 * that element being the fits url */
37 public void writeRow(Object[] colValues) throws IOException {
38
39 printOut.println("<TABLE>");
40 printOut.println("<DATA><FITS>");
41
42 printOut.println(" <STREAM>"+colValues[0]+"</STREAM>");
43
44 printOut.println("</FITS></DATA>");
45 printOut.println("</TABLE>");
46
47 }
48
49 public void endTable() {
50
51 }
52
53
54 }
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90