uk.ac.starlink.ttools.votlint
Class VersionDetector

java.lang.Object
  extended by uk.ac.starlink.ttools.votlint.VersionDetector

public class VersionDetector
extends Object

Determines the version of a VOTable document.

Since:
20 Nov 2012
Author:
Mark Taylor

Constructor Summary
VersionDetector()
           
 
Method Summary
static String getVersionString(BufferedInputStream in)
          Determines the reported version of a VOTable document contained in an input stream.
static void main(String[] args)
          Prints out the version number of a VOTable file presented on standard input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionDetector

public VersionDetector()
Method Detail

getVersionString

public static String getVersionString(BufferedInputStream in)
                               throws IOException
Determines the reported version of a VOTable document contained in an input stream. The attributes on the first encountered VOTABLE start tag are used. A "version" attribute is used if available, otherwise the namespacing attributes are trawled. Mark/reset is used; whether a version string is identified or not, the stream is reset to the starting position on exit.

Parameters:
in - input stream
Returns:
declared version string, or null if none can be found
Throws:
IOException

main

public static void main(String[] args)
                 throws IOException
Prints out the version number of a VOTable file presented on standard input.

Throws:
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.