Skip to content

Commit

Permalink
docs: update javadoc sample code comments to render correctly in Clou…
Browse files Browse the repository at this point in the history
…d RAD (#1121)

Co-authored-by: Burke Davison <40617934+burkedavison@users.noreply.github.com>
alicejli and burkedavison authored Oct 28, 2024
1 parent 15a110d commit ab4d5e7
Showing 24 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAppEngineAuthorizationCodeCallbackServlet {
*
* &#64;Override
@@ -77,7 +77,7 @@
* "https://server.example.com/authorize").setCredentialStore(new AppEngineCredentialStore())
* .build();
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAppEngineAuthorizationCodeServlet {
*
* &#64;Override
@@ -71,7 +71,7 @@
* .build();
* }
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Original file line number Diff line number Diff line change
@@ -84,14 +84,14 @@ public boolean load(String userId, Credential credential) {
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public static AppEngineDataStore migrate(AppEngineCredentialStore credentialStore)
* throws IOException {
* AppEngineDataStore dataStore = new AppEngineDataStore();
* credentialStore.migrateTo(dataStore);
* return dataStore;
* }
* </pre>
* }</pre>
*
* @param dataStoreFactory App Engine data store factory
* @since 1.16
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAppEngineAuthorizationCodeCallbackServlet {
*
* &#64;Override
@@ -77,7 +77,7 @@
* "https://server.example.com/authorize").setCredentialStore(new AppEngineCredentialStore())
* .build();
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAppEngineAuthorizationCodeServlet {
*
* &#64;Override
@@ -71,7 +71,7 @@
* .build();
* }
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Original file line number Diff line number Diff line change
@@ -174,14 +174,14 @@ private void save() throws IOException {
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public static FileDataStore migrate(FileCredentialStore credentialStore, File dataDirectory)
* throws IOException {
* FileDataStore dataStore = new FileDataStore(dataDirectory);
* credentialStore.migrateTo(dataStore);
* return dataStore;
* }
* </pre>
* }</pre>
*
* @param dataStoreFactory file data store factory
* @throws IOException
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAuthorizationCodeCallbackServlet {
*
* &#64;Override
@@ -81,7 +81,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAuthorizationCodeServlet {
*
* &#64;Override
@@ -83,7 +83,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAuthorizationCodeCallbackServlet {
*
* &#64;Override
@@ -81,7 +81,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAuthorizationCodeServlet {
*
* &#64;Override
@@ -83,7 +83,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Original file line number Diff line number Diff line change
@@ -41,13 +41,13 @@
*
* <p>Sample usage, taking advantage that this class implements {@link HttpRequestInitializer}:
*
* <pre>
* <pre>{@code
* public static HttpRequestFactory createRequestFactory(HttpTransport transport) {
* OAuthParameters parameters = new OAuthParameters();
* // ...
* return transport.createRequestFactory(parameters);
* }
* </pre>
* }</pre>
*
* <p>If you have a custom request initializer, take a look at the sample usage for {@link
* HttpExecuteInterceptor}, which this class also implements.
Original file line number Diff line number Diff line change
@@ -174,15 +174,15 @@ protected AuthorizationCodeFlow(Builder builder) {
* the {@link #getAuthorizationServerEncodedUrl()}, {@link #getClientId()}, and {@link
* #getScopes()}. Sample usage:
*
* <pre>
* <pre>{@code
* private AuthorizationCodeFlow flow;
*
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
* String url = flow.newAuthorizationUrl().setState("xyz")
* .setRedirectUri("https://client.example.com/rd").build();
* response.sendRedirect(url);
* }
* </pre>
* }</pre>
*/
public AuthorizationCodeRequestUrl newAuthorizationUrl() {
AuthorizationCodeRequestUrl url =
Original file line number Diff line number Diff line change
@@ -31,14 +31,14 @@
*
* <p>Sample usage for a web application:
*
* <pre>
* <pre>{@code
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
* String url =
* new AuthorizationCodeRequestUrl("https://server.example.com/authorize", "s6BhdRkqt3")
* .setState("xyz").setRedirectUri("https://client.example.com/rd").build();
* response.sendRedirect(url);
* }
* </pre>
* }</pre>
*
* <p>Implementation is not thread-safe.
*
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
* StringBuffer fullUrlBuf = request.getRequestURL();
* if (request.getQueryString() != null) {
@@ -42,7 +42,7 @@
* // request access token using authResponse.getCode()...
* }
* }
* </pre>
* }</pre>
*
* <p>Implementation is not thread-safe.
*
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response =
@@ -58,7 +58,7 @@
* }
* }
* }
* </pre>
* }</pre>
*
* <p>Some OAuth 2.0 providers don't support {@link BasicAuthentication} but instead support {@link
* ClientParametersAuthentication}. In the above sample code, simply replace the class name and it
Original file line number Diff line number Diff line change
@@ -27,14 +27,14 @@
*
* <p>Sample usage for a web application:
*
* <pre>
* <pre>{@code
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
* String url = new AuthorizationRequestUrl(
* "https://server.example.com/authorize", "s6BhdRkqt3", Arrays.asList("code")).setState("xyz")
* .setRedirectUri("https://client.example.com/rd").build();
* response.sendRedirect(url);
* }
* </pre>
* }</pre>
*
* <p>Implementation is not thread-safe.
*
Original file line number Diff line number Diff line change
@@ -27,14 +27,14 @@
*
* <p>Sample usage for a web application:
*
* <pre>
* <pre>{@code
* public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
* String url = new BrowserClientRequestUrl(
* "https://server.example.com/authorize", "s6BhdRkqt3").setState("xyz")
* .setRedirectUri("https://client.example.com/cb").build();
* response.sendRedirect(url);
* }
* </pre>
* }</pre>
*
* <p>Implementation is not thread-safe.
*
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response =
@@ -56,7 +56,7 @@
* }
* }
* }
* </pre>
* }</pre>
*
* <p>Some OAuth 2.0 providers don't support {@link BasicAuthentication} but instead support {@link
* ClientParametersAuthentication}. In the above sample code, simply replace the class name and it
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response = new AuthorizationCodeTokenRequest(new NetHttpTransport(),
@@ -56,7 +56,7 @@
* }
* }
* }
* </pre>
* }</pre>
*
* <p>Implementation is immutable and thread-safe.
*
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public static Credential createCredentialWithAccessTokenOnly(
* HttpTransport transport, JsonFactory jsonFactory, TokenResponse tokenResponse) {
* return new Credential(BearerToken.authorizationHeaderAccessMethod()).setFromTokenResponse(
@@ -61,7 +61,7 @@
* .build()
* .setFromTokenResponse(tokenResponse);
* }
* </pre>
* }</pre>
*
* <p>If you need to persist the access token in a data store, use {@link DataStoreFactory} and
* {@link Builder#addRefreshListener(CredentialRefreshListener)} with {@link
Original file line number Diff line number Diff line change
@@ -28,14 +28,14 @@
* <p>It needs to be added as a refresh listener using {@link
* Credential.Builder#addRefreshListener}. Sample usage:
*
* <pre>
* <pre>{@code
* static void addDataStoreCredentialRefreshListener(
* Credential.Builder credentialBuilder, String userId, DataStoreFactory dataStoreFactory)
* throws IOException {
* credentialBuilder.addRefreshListener(
* new DataStoreCredentialRefreshListener(userId, dataStoreFactory));
* }
* </pre>
* }</pre>
*
* @since 1.6
* @author Yaniv Inbar
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response =
@@ -59,7 +59,7 @@
* }
* }
* }
* </pre>
* }</pre>
*
* <p>Some OAuth 2.0 providers don't support {@link BasicAuthentication} but instead support {@link
* ClientParametersAuthentication}. In the above sample code, simply replace the class name and it
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void refreshAccessToken() throws IOException {
* try {
* TokenResponse response =
@@ -57,7 +57,7 @@
* }
* }
* }
* </pre>
* }</pre>
*
* <p>Some OAuth 2.0 providers don't support {@link BasicAuthentication} but instead support {@link
* ClientParametersAuthentication}. In the above sample code, simply replace the class name and it
Original file line number Diff line number Diff line change
@@ -32,12 +32,12 @@
*
* <p>Implementation is not thread-safe. Sample usage:
*
* <pre>
* <pre>{@code
* static JsonWebSignature executeIdToken(TokenRequest tokenRequest) throws IOException {
* IdTokenResponse idTokenResponse = IdTokenResponse.execute(tokenRequest);
* return idTokenResponse.parseIdToken();
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar

0 comments on commit ab4d5e7

Please sign in to comment.