在dropbox中上传文件的新分区

时间:2013-10-07 18:10:37

标签: dropbox dropbox-api

我想使用android api在Dropbox中添加文档(Test.doc)的修订版。我试过了

    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) {}
     }
}

第一次执行时,会创建新修订。但是当第二次执行相同的代码时,会创建修订。请帮我解决这个问题。

0 个答案:

没有答案