public String getServerVersion ( ) throws IOException { // only do this once -- future invocations will use the known value if ( m_serverVersion == null ) { // Make the APIA call for describe repository // and make sure that HTTP 302 status is handled. String desc = getResponseAsString ( "/describe?xml=true" , true , true ) ; logger . debug ( "describeRepository response:\n" + desc ) ; String [ ] parts = desc . split ( "<repositoryVersion>" ) ; if ( parts . length < 2 ) { throw new IOException ( "Could not find repositoryVersion element in content of /describe?xml=true" ) ; } int i = parts [ 1 ] . indexOf ( "<" ) ; if ( i == - 1 ) { throw new IOException ( "Could not find end of repositoryVersion element in content of /describe?xml=true" ) ; } m_serverVersion = parts [ 1 ] . substring ( 0 , i ) . trim ( ) ; logger . debug ( "Server version is " + m_serverVersion ) ; } return m_serverVersion ; }
Get the version reported by the remote Fedora server .