Class RequestTokenGrantReceiver
java.lang.Object
com.amilesend.tmdb.client.connection.auth.RequestTokenGrantReceiver
- All Implemented Interfaces:
AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Open a browser at the given URL usingDesktop
if available, or alternatively output the URL toSystem.out
for command-line applications.builder()
void
close()
Closes the HTTP server resource.<T> T
start()
Starts the HTTP server to handle OAuth callbacks.void
stop()
Stops the running HTTP server.boolean
Blocks 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:
close
in interfaceAutoCloseable
- Throws:
SessionException
- if an error occurred while closing the HTTP server resource
-
browse
Open a browser at the given URL usingDesktop
if available, or alternatively output the URL toSystem.out
for 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
null
if the server is stopped byclose()
- Throws:
SessionException
- if an error occurred
-
builder
-