dropboxdropbox-apidropbox-sdk

DropBox does not auto rename file during upload


I'm using Dropbox Java API to upload file.

Following code does not upload file with auto rename:

void uploadFile(@NonNull final String inPath, @NonNull final InputStream inputStream) throws IOException, DbxException {
    client.files()
        .uploadBuilder(inPath)
        .withMode(WriteMode.ADD)
        .withAutorename(true)
        .uploadAndFinish(inputStream);
}

Can you please suggest what am I doing wrong?


Solution

  • The answer is that: Dropbox does not consider there to be a conflict if you upload content identical to what's already in that file, and the rename will only occur on conflict.