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));
|
.withValue(done));
|
||||||
|
|
||||||
com.pcloud.sdk.DataSource pCloudDataSource = new com.pcloud.sdk.DataSource() {
|
com.pcloud.sdk.DataSource pCloudDataSource = new com.pcloud.sdk.DataSource() {
|
||||||
|
@Override
|
||||||
|
public long contentLength() {
|
||||||
|
return data.size(context).get();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(BufferedSink sink) throws IOException {
|
public void writeTo(BufferedSink sink) throws IOException {
|
||||||
try (Source source = Okio.source(data.open(context))) {
|
try (Source source = Okio.source(data.open(context))) {
|
||||||
@ -196,7 +201,7 @@ class PCloudImpl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return client() //
|
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();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user