I want to upload and download files to any cloud from my desktop Java application. I searched on web and found about Temboo. I tried to use it and write some code to create a sample folder in my DropBox account.
I created an App in my DropBox and got App Key and App Secret. Then I used https://live.temboo.com/library/Library/Dropbox/FileOperations/CreateFolder/ OAUTH wizard and got my Access Token and Access Token Secret. Now, I try to run below code to create a Folder with the name "Test"
CreateFolder createFolder = new com.temboo.Library.Dropbox.FileOperations.CreateFolder(session);
CreateFolder.CreateFolderInputSet createFolderInput = createFolder.newInputSet();
createFolderInput.set_NewFolderName(DROPBOX_BACKUP_FOLDERNAME);
createFolderInput.set_AppKey(DROPBOX_APP_KEY);
createFolderInput.set_AppSecret(DROPBOX_APP_SECRET);
createFolderInput.set_AccessToken(DROPBOX_ACCESS_TOKEN);
createFolderInput.set_AccessTokenSecret(DROPBOX_ACCESS_TOKEN_SECRET);
createFolder.execute(createFolderInput);
And When I run above code it is throwing exception on:
createFolder.execute(createFolderInput);
Please have a look at exceptions:
com.temboo.core.TembooException: peer not authenticated
at com.temboo.core.TembooSession.postContent(TembooSession.java:168)
at com.temboo.core.Choreography.executeWithResults(Choreography.java:88)
at com.temboo.Library.Dropbox.FileOperations.CreateFolder.execute(CreateFolder.java:50)
at TestPackage.DropBoxCloudServer.createFolder(DropBoxCloudServer.java:55)
at TestPackage.DropBoxCloudServer.main(DropBoxCloudServer.java:20)
Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at com.sun.net.ssl.internal.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:352)
at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:339)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:576)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:554)
at com.temboo.core.TembooSession.postContent(TembooSession.java:151)
... 4 more
Hi I just found solution to this by myself.. I just updated my Java to latest JDK version and it is working f9.. appart from this I need to add
createFolderInput.set_Root("sandbox");
to my code .. It is now working perfect ..