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
  • Loading branch information
alicejli committed Jul 24, 2024
1 parent 75a7462 commit 4321cb6
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAppEngineAuthorizationCodeCallbackServlet {
*
* &#64;Override
Expand Down Expand Up @@ -77,7 +77,7 @@
* "https://server.example.com/authorize").setCredentialStore(new AppEngineCredentialStore())
* .build();
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAppEngineAuthorizationCodeServlet {
*
* &#64;Override
Expand Down Expand Up @@ -71,7 +71,7 @@
* .build();
* }
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAppEngineAuthorizationCodeCallbackServlet {
*
* &#64;Override
Expand Down Expand Up @@ -77,7 +77,7 @@
* "https://server.example.com/authorize").setCredentialStore(new AppEngineCredentialStore())
* .build();
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAppEngineAuthorizationCodeServlet {
*
* &#64;Override
Expand Down Expand Up @@ -71,7 +71,7 @@
* .build();
* }
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAuthorizationCodeCallbackServlet {
*
* &#64;Override
Expand Down Expand Up @@ -81,7 +81,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAuthorizationCodeServlet {
*
* &#64;Override
Expand Down Expand Up @@ -83,7 +83,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.7
* @author Yaniv Inbar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletCallbackSample extends AbstractAuthorizationCodeCallbackServlet {
*
* &#64;Override
Expand Down Expand Up @@ -81,7 +81,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* public class ServletSample extends AbstractAuthorizationCodeServlet {
*
* &#64;Override
Expand Down Expand Up @@ -83,7 +83,7 @@
* // return user ID
* }
* }
* </pre>
* }</pre>
*
* @since 1.36.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -42,7 +42,7 @@
* // request access token using authResponse.getCode()...
* }
* }
* </pre>
* }</pre>
*
* <p>Implementation is not thread-safe.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response =
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response =
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response = new AuthorizationCodeTokenRequest(new NetHttpTransport(),
Expand All @@ -56,7 +56,7 @@
* }
* }
* }
* </pre>
* }</pre>
*
* <p>Implementation is immutable and thread-safe.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* <p>Sample usage:
*
* <pre>
* <pre>{@code
* static void requestAccessToken() throws IOException {
* try {
* TokenResponse response =
Expand All @@ -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
Expand Down
Loading

0 comments on commit 4321cb6

Please sign in to comment.