0

I know very little about writing code for a client that would access a website account. I've been to different websites that contain so much information that I am just lost. Here is what I found:

  1. For the client to take advantage of, say, remote file operations on a Dropbox account, Dropbox's cloud API needs to be integrated.
  2. But to do that, the client needs to receive an authentication token with the OAuth 2.0 protocol.
  3. Before I can do that, I have to establish an HTTP connection between the client and the cloud.
  4. Before I do that, I need to use libcurl or Java SDK for Dropbox.
  5. Before I decide on whether to use libcurl, Dropbox Java SDK, or Java standard libraries, I need to find out which one is better for HTTP and SMTP protocols.

Now, correct me if I'm wrong on any of the numbered points above.

Here's a question: what library or SDK would you recommend me for using both HTTP and SMTP protocols? (I would have chosen Dropbox's Chooser as pointed out in the thread Client-only Dropbox access, but that's a JavaScript component, and my custom client app needs to take care of authentication and handle HTTP and SMTP requests.)

Any help is appreciated.

Community
  • 1
  • 1
Andrei
  • 135
  • 5
  • 18
  • 1
    I'm a bit confused as to why SMTP is needed? This seems pretty straight-forward to me, have you tried implementing the example, at least partially? https://www.dropbox.com/developers/core/start/php Might give you a better idea of what's going on and how to use it. –  Nov 17 '13 at 21:45
  • I will need SMTP later on for two (server-less) clients to chat with each other. I will try your example shortly. I didn't know where to start; that's why I've missed the page you've posted. Also, I did not know that PHP would come into the picture. – Andrei Nov 17 '13 at 21:49
  • 2
    I see now, well, usually if the company is popular and they provide an API, they'll have fairly good documentation for it available as well on their site and generally more up-to-date than what could be available on the web. So that's the best point to start from. Hope it solves your problem. –  Nov 17 '13 at 21:52
  • Just realized I gave you the PHP tutorial, this one is for Java https://www.dropbox.com/developers/core/start/java in case you haven't found it by yourself already –  Nov 17 '13 at 22:09
  • Yes, I've noticed that. I was a bit puzzled for a moment, but now I found the right page. Thank you anyways. – Andrei Nov 17 '13 at 22:14
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/41391/discussion-between-andrey-and-pallandt) – Andrei Nov 18 '13 at 08:04

2 Answers2

0

I've chosen the Java SDK for the Dropbox cloud storage provider. As pallandt has pointed out, the page https://www.dropbox.com/developers/core/start/java could get you started on what to do first to employ the Dropbox Java SDK:

  1. Save the complete Main class code on the page to a java file.
  2. On the same page find the link "install the Java SDK".
  3. Follow the instructions on that page.

From there on comes a part of actually employing the SDK. The thread Cannot install a jar package without an IDE has comments under the OP that go off into a chat, which you may find really helpful. You might have to use an IDE like Eclipse to facilitate the importation of "com.dropbox.core".

Community
  • 1
  • 1
Andrei
  • 135
  • 5
  • 18
0

I have been researching this for a while now and never really found a simple solution. This morning i tried something really simple and it actually worked.

    public void testDropboxConnection() {
    Path tmpF = Paths.get(System.getProperty("user.home") + File.separatorChar + "Dropbox//folder//");
    try {
        Files.createDirectories(tmpF);
    } catch (IOException ex) {
        Logger.getLogger(RefineryData.class.getName()).log(Level.SEVERE, null, ex);
    }
}

I tested this and it sync's perfectly