Uploading new resisions for files in dropbox
I want to add revisions to the document(Test.doc) in Dropbox using android api. 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) {}
}
}
While executing first time, new revision is created. but when executing the same code second time, revisions are getting created. Please help me resolve this.
链接地址: http://www.djcxy.com/p/69078.html上一篇: 在脚本中上传Dropbox
下一篇: 上传Dropbox中文件的新分区