我们正在编写的BigQuery一个开源的JDBC驱动程序,并跑进以下问题:
我们希望我们的授权使用OAuth 2驱动程序安装的应用程序。 在Windows XP,Windows 7的64位,Windows 7 64位系统+ RDP它工作正常。 但是这是一个在Windows Server 2008 R2 + RDP失败的测试平台。
基本上,我们打开一个网页浏览器,他登录,我们赶上了回复,并验证用户。
下面是该网址打开的代码:
private static void browse(String url) {
// first try the Java Desktop
logger.debug("First try the Java Desktop");
if (Desktop.isDesktopSupported()) {
Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Action.BROWSE))
try {
desktop.browse(URI.create(url));
return;
} catch (IOException e) {
// handled below
}
}
// Next try rundll32 (only works on Windows)
logger.debug("Try the rundll32");
try {
Runtime.getRuntime().exec(
"rundll32 url.dll,FileProtocolHandler " + url);
return;
} catch (IOException e) {
// handled below
}
// Next try browsers
logger.debug("Try with browsers");
BareBonesBrowserLaunch.openURL(url);
}
我想通了就是:BareBonesBrowserLaunch不开的联系,也没有了FileProtocolHandler。
该URL lenght正在250character一点点。
任何援助将不胜感激!