public Revision getRevision ( final int revisionID ) throws WikiApiException { try { if ( revisionID < 1 ) { throw new IllegalArgumentException ( ) ; } int fullRevPK = - 1 ; int limit = 1 ; PreparedStatement statement = null ; ResultSet result = null ; try { statement = this . connection . prepareStatement ( "SELECT FullRevisionPK, RevisionPK " + "FROM index_revisionID " + "WHERE revisionID=? LIMIT 1" ) ; statement . setInt ( 1 , revisionID ) ; result = statement . executeQuery ( ) ; if ( result . next ( ) ) { fullRevPK = result . getInt ( 1 ) ; limit = ( result . getInt ( 2 ) - fullRevPK ) + 1 ; } else { throw new WikiPageNotFoundException ( "The revision with the ID " + revisionID + " was not found." ) ; } } finally { if ( statement != null ) { statement . close ( ) ; } if ( result != null ) { result . close ( ) ; } } return buildRevisionMetaData ( fullRevPK , limit ) ; } catch ( WikiPageNotFoundException e ) { throw e ; } catch ( Exception e ) { throw new WikiApiException ( e ) ; } }
Returns the by the id specified revision .