lookfirst / sardine

an easy to use webdav client for java
Other
572 stars 184 forks source link

Cannot upload files to the root directory using Sardine library #384

Closed P529 closed 1 year ago

P529 commented 1 year ago

I am using the Sardine library in Java to upload files to a WebDAV server. When attempting to upload files to the root directory (.../remote.php/dav/files/p529/), I encounter the following error:

java.lang.RuntimeException: org.apache.http.client.ClientProtocolException ... org.apache.http.client.NonRepeatableRequestException: Cannot retry request with a non-repeatable request entity.

The issue arises only when trying to upload to the root directory; creating folders in the root directory and uploading to subdirectories works fine.

Steps to reproduce in the application im running (ServerBackup Minecraft Mod):

1. Use Sardine library to upload a file to the root directory of the specified WebDAV server.
2. Observe the exception mentioned above.

Expected behavior: I expect to be able to upload files to the root directory using the Sardine library without encountering the NonRepeatableRequestException.

Additional information:

  1. Sardine Library Version: 5.10
  2. Java Version: 8.372 Azul

This is the Code Snippet where I encounter the issue:

GitHub Gist of usage

This is the Log I receive in my application, I've tried to achieve more verbose logging but was not able to.

ErrorLog.txt

I've also tried to use sardine.put() in combination with a ByteArray and that worked, however I have to deal with rather large files and relatively little ram so its not an option.

Maybe this information also helps, im using nextCloud and their WebDav functionality and checked with WinScp if I am able to upload files directly to the root directory which also works.

Best regards P529