Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser handler #182

Merged
merged 3 commits into from
Aug 2, 2018
Merged

Browser handler #182

merged 3 commits into from
Aug 2, 2018

Conversation

hanslovsky
Copy link
Contributor

As outlined in #175 it is desirable in some cases to not use the java.awt.Desktop to browse the authorizationUrl in AuthorizationCodeInstalledApp, e.g. when running a JavaFX UI. For that purpose, I created a Browser interface with a single browse(String) method that is passed as an argument to AuthorizationCodeInstalledApp. In order not to introduce any breaking changes, there is also a DefaultBrowser that simply delegates to AuthorizationCodeInstalledApp.browse.

Fixes #175

Note: mvn findbugs:check fails but it also fails on the dev branch.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@hanslovsky
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR!

System.out.println(" " + url);
try {
browser.browse(url);
} catch (Exception e) {

This comment was marked as spam.

This comment was marked as spam.

* @param url url to browse
* @throws Exception
*/
public void browse(String url) throws Exception;

This comment was marked as spam.

This comment was marked as spam.

browse(authorizationUrl.build());
String url = authorizationUrl.build();
Preconditions.checkNotNull(url);
System.out.println("Please open the following address in your browser:");

This comment was marked as spam.

This comment was marked as spam.

 - Browser.browse throws IOException instead of Exception
 - Do not swallow exceptions but let caller deal with it
 - Remove superfluous println statements
Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM.

We're currently blocked on new features so we can't merge this yet.

@chingor13 chingor13 added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jul 17, 2018
@jeanbza jeanbza removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Aug 2, 2018
@chingor13 chingor13 merged commit f82cd2e into googleapis:dev Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants