View Javadoc

1   /*$Id: XmlResults.java,v 1.1 2005/03/10 16:42:55 mch Exp $
2    * Created on 13-Nov-2003
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid
7    * Software License version 1.2, a copy of which has been included
8    * with this distribution in the LICENSE.txt file.
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  $Log: XmlResults.java,v $
48  Revision 1.1  2005/03/10 16:42:55  mch
49  Split fits, sql and xdb
50  
51  Revision 1.1.1.1  2005/02/17 18:37:35  mch
52  Initial checkin
53  
54  Revision 1.1.1.1  2005/02/16 17:11:24  mch
55  Initial checkin
56  
57  Revision 1.2.24.4  2004/12/08 18:36:40  mch
58  Added Vizier, rationalised SqlWriters etc, separated out TableResults from QueryResults
59  
60   
61  */