public boolean updateSchema ( String text , ContentType contentType ) { Utils . require ( text != null && text . length ( ) > 0 , "text" ) ; Utils . require ( contentType != null , "contentType" ) ; try { // Send a PUT request to "/_applications/{application}". byte [ ] body = Utils . toBytes ( text ) ; StringBuilder uri = new StringBuilder ( "/_applications/" ) ; uri . append ( Utils . urlEncode ( m_appDef . getAppName ( ) ) ) ; RESTResponse response = m_restClient . sendRequest ( HttpMethod . PUT , uri . toString ( ) , contentType , body ) ; m_logger . debug ( "updateSchema() response: {}" , response . toString ( ) ) ; throwIfErrorResponse ( response ) ; return true ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Update the schema for this session s application with the given definition . The text must be formatted in XML or JSON as defined by the given content type . True is returned if the update was successful . An exception is thrown if an error occurred .