Class VersionDetector


  • public class VersionDetector
    extends java.lang.Object
    Determines the version of a VOTable document.
    Since:
    20 Nov 2012
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      VersionDetector()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getVersionString​(java.io.BufferedInputStream in)
      Determines the reported version of a VOTable document contained in an input stream.
      static void main​(java.lang.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 java.lang.String getVersionString​(java.io.BufferedInputStream in)
                                                 throws java.io.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:
        java.io.IOException
      • main

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