@ GET @ Path ( "/{localeCode}" ) @ Produces ( MediaType . APPLICATION_JSON ) @ RequiresPermissions ( I18nPermissions . LOCALE_READ ) public Response getSupportedLocale ( @ PathParam ( "localeCode" ) String localeCode ) { WebAssertions . assertNotNull ( localeCode , "The locale should not be null" ) ; LocaleRepresentation locale = supportedLocaleFinder . findSupportedLocale ( localeCode ) ; if ( locale != null ) { return Response . ok ( locale ) . build ( ) ; } return Response . status ( Response . Status . NOT_FOUND ) . build ( ) ; }
Returns the requested locale .