0

I want to add a new revision to the document(Test.doc) in Dropbox using android api. Can anyone share me any sample code or links. I tried

    FileInputStream inputStream = null;
try {                    
     DropboxInputStream temp = mDBApi.getFileStream("/Test.doc", null);
     String revision = temp.getFileInfo().getMetadata().rev;
     Log.d("REVISION : ",revision);

     File file = new File("/sdcard0/renamed.doc");
     inputStream = new FileInputStream(file);                    
     Entry newEntry = mDBApi.putFile("/Test.doc", inputStream, file.length(), revision, new ProgressListener() {

    @Override
    public void onProgress(long arg0, long arg1) {
         Log.d("","Uploading.. "+arg0+", Total : "+arg1);
    }
});

 } catch (Exception e) {
     System.out.println("Something went wrong: " + e);
 } finally {
     if (inputStream != null) {
         try {
             inputStream.close();
         } catch (IOException e) {}
     }
}

New revision is created for first time. When i execute again, another new revision is not getting created.

4

0 回答 0