简体   繁体   中英

cloudrail java desktop app

I'm trying to use cloudrail SDK in my java desktop app for testing , but I have problem with runing the sample code in cloudrailsite; the following codes are main class:

public class DropboxWithCloudRail {
  private static String REDIRECT_URL = "http://localhost:3000/";
  InputStream inputStream = null;
  public void loadDropbox() throws FileNotFoundException, ParseException {
    CloudRail.setAppKey("*************");
    Dropbox service = new Dropbox(new LocalReceiver(8082),
            "*************",
            "*************",
            REDIRECT_URL,
            "Dropbox"                
    );         

    service.createFolder(
      "/myFolder1"
    );         
  }
}

I set the Redirect URIs in dropbox console http://localhost:3000/

but when I run the project , I get this page:

This site can’t be reached

localhost refused to connect.
Did you mean http://localhost3000.org/?
Search Google for localhost 3000
ERR_CONNECTION_REFUSED

The issue seems to be that you configure your LocalRedirect receiver with the port 8082 which makes it wait for incoming redirects on http://localhost:8082 . So this is the URL you have to use as a redirect uri for Dropbox and not http://localhost:3000 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM