Hello, when i try to connect to the Java App i've created for the first time using no redirect requesting i get a fatal error just on the DbxAuthFinish, giving me a java.lang.ExceptionInitializerError. I checked out many times but my code is still the same as the example found in the API tutorials. Here is my code:
String accessToken = "";
String userLocale = null;
DbxRequestConfig requestConfig = new DbxRequestConfig("text-edit/0.1",userLocale);
DbxAppInfo appInfo = new DbxAppInfo(APP_KEY,SECRET_KEY);
DbxWebAuth auth = new DbxWebAuth(requestConfig, appInfo);
DbxWebAuth.Request requestAuth = DbxWebAuth.newRequestBuilder().withNoRedirect().build();
String authorizeUrl = auth.authorize(requestAuth);
System.out.println("1. Go to " + authorizeUrl);
System.out.println("2. Click \"Allow\" (you might have to log in first).");
System.out.println("3. Copy the authorization code.");
//Abrimos el enlace de autenticación del paciente en la carpeta de DropBox
try {
URL authenticationURL = new URL(authorizeUrl);
Desktop.getDesktop().browse(authenticationURL.toURI());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String code = JOptionPane.showInputDialog(this.ventanaControlada, "Inserta el codigo de verificación.");
System.out.println(code);
code = code.trim();
try {
DbxAuthFinish authFinish = auth.finishFromCode(code);
accessToken = authFinish.getAccessToken();
} catch (Exception e) {
Thanks for all, i hope you can find any response soon!