protected < T > T doGet ( String path , Class < T > cls , MultivaluedMap < String , String > headers ) throws ClientException { this . readLock . lock ( ) ; try { WebResource . Builder requestBuilder = getResourceWrapper ( ) . rewritten ( path , HttpMethod . GET ) . getRequestBuilder ( ) ; requestBuilder = ensureJsonHeaders ( headers , requestBuilder , false , true ) ; ClientResponse response = requestBuilder . get ( ClientResponse . class ) ; errorIfStatusNotEqualTo ( response , ClientResponse . Status . OK ) ; return response . getEntity ( cls ) ; } catch ( ClientHandlerException ex ) { throw new ClientException ( ClientResponse . Status . INTERNAL_SERVER_ERROR , ex . getMessage ( ) ) ; } finally { this . readLock . unlock ( ) ; } }
Gets the resource specified by the path .