You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No problem using org.aarboard.nextcloud.api.NextcloudConnector.downloadFile(String, String) to directly save a file.
But if I use org.aarboard.nextcloud.api.NextcloudConnector.downloadFile(String) :
try (InputStream in = nextcloud.downloadFile(path + "/" + fileName)) {
int bytesRead;
byte[] buffer = new byte[4096];
try (OutputStream outStream = new FileOutputStream("/Users/development/" + fileName)) {
while ((bytesRead = in.read(buffer)) != -1) {
outStream.write(buffer, 0, bytesRead);
}
outStream.flush();
outStream.close();
}
}
it fails with:
org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 2,208,611; received: 6,745)
at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:140) ~[httpcore-4.4.14.jar:4.4.14]
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:118) ~[httpclient-4.5.13.jar:4.5.13]
at com.github.sardine.impl.io.ByteCountInputStream.read(ByteCountInputStream.java:44) ~[sardine-5.10.jar:5.10]
at com.github.sardine.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:50) ~[sardine-5.10.jar:5.10]
at org.apache.commons.io.input.ProxyInputStream.read(ProxyInputStream.java:62) ~[commons-io-2.8.0.jar:2.8.0]
Am I doing something wrong?
Library version: 11.5.0
Nextcloud version: 17.0.0
The text was updated successfully, but these errors were encountered:
No problem using
org.aarboard.nextcloud.api.NextcloudConnector.downloadFile(String, String)
to directly save a file.But if I use
org.aarboard.nextcloud.api.NextcloudConnector.downloadFile(String)
:it fails with:
Am I doing something wrong?
Library version: 11.5.0
Nextcloud version: 17.0.0
The text was updated successfully, but these errors were encountered: