Class RequestTokenGrantReceiver
java.lang.Object
com.amilesend.tmdb.client.connection.auth.RequestTokenGrantReceiver
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic voidOpen a browser at the given URL usingDesktopif available, or alternatively output the URL toSystem.outfor command-line applications.builder()voidclose()Closes the HTTP server resource.<T> Tstart()Starts the HTTP server to handle OAuth callbacks.voidstop()Stops the running HTTP server.booleanBlocks until the server receives a request token grant approval, or when the server is stopped bystop().
-
Method Details
-
close
Closes the HTTP server resource.- Specified by:
closein interfaceAutoCloseable- Throws:
SessionException- if an error occurred while closing the HTTP server resource
-
browse
Open a browser at the given URL usingDesktopif available, or alternatively output the URL toSystem.outfor command-line applications.- Parameters:
url- URL to browse
-
start
Starts the HTTP server to handle OAuth callbacks.- Returns:
- this OAuthReceiver instance
- Throws:
SessionException- if an error occurred while starting the HTTP server
-
stop
Stops the running HTTP server.- Throws:
SessionException- if an error occurred while stopping the server
-
waitForApprovalStatus
Blocks until the server receives a request token grant approval, or when the server is stopped bystop().- Returns:
- authorization code if login succeeds; may return
nullif the server is stopped byclose() - Throws:
SessionException- if an error occurred
-
builder
-