fix: override contentLength to return size of data
This commit is contained in:
parent
ad8d5338ca
commit
b08a9cb549
@ -187,6 +187,11 @@ class PCloudImpl {
|
||||
.withValue(done));
|
||||
|
||||
com.pcloud.sdk.DataSource pCloudDataSource = new com.pcloud.sdk.DataSource() {
|
||||
@Override
|
||||
public long contentLength() {
|
||||
return data.size(context).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeTo(BufferedSink sink) throws IOException {
|
||||
try (Source source = Okio.source(data.open(context))) {
|
||||
@ -196,7 +201,7 @@ class PCloudImpl {
|
||||
};
|
||||
|
||||
return client() //
|
||||
.createFile(((PCloudFolder) file.getParent()).getId(), file.getName(), pCloudDataSource, new Date(), listener, uploadOptions) //
|
||||
.createFile(file.getParent().getId(), file.getName(), pCloudDataSource, new Date(), listener, uploadOptions) //
|
||||
.execute();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user