Release 2.6.6 by JoshuaYin · Pull Request #52 · ucloud/ufile-sdk-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
2 changes: 1 addition & 1 deletion ufile-sample-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>cn.ucloud.ufile</groupId>
<artifactId>ufile-client-java</artifactId>
<version>2.6.5</version>
<version>2.6.6</version>
</dependency>
</dependencies>

Expand Down
5 changes: 4 additions & 1 deletion ufile/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>cn.ucloud.ufile</groupId>
<artifactId>ufile</artifactId>
<packaging>pom</packaging>
<version>2.6.5</version>
<version>2.6.6</version>

<modules>
<module>ufile-core</module>
Expand Down Expand Up @@ -131,6 +131,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${plugin.maven.gpg.version}</version>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<phase>verify</phase>
Expand Down
6 changes: 3 additions & 3 deletions ufile/ufile-client-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<artifactId>ufile</artifactId>
<groupId>cn.ucloud.ufile</groupId>
<version>2.6.5</version>
<version>2.6.6</version>
</parent>

<artifactId>ufile-client-java</artifactId>
<version>2.6.5</version>
<version>2.6.6</version>

<dependencies>
<dependency>
Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>cn.ucloud.ufile</groupId>
<artifactId>ufile-core</artifactId>
<version>2.6.5</version>
<version>2.6.6</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class DownloadFileApi extends UfileObjectApi<DownloadFileBean> {
/**
* 分片数量
*/
private int partCount = 0;
private long partCount = 0;
/**
* 分片任务集
*/
Expand Down Expand Up @@ -224,7 +224,7 @@ public DownloadFileApi setBufferSize(int bufferSize) {
protected void prepareData() throws UfileClientException {
parameterValidat();

partCount = 0;
partCount = 0L;

File dir = new File(localPath);
if (!dir.exists() || (dir.exists() && !dir.isDirectory()))
Expand Down Expand Up @@ -260,7 +260,8 @@ protected void prepareData() throws UfileClientException {
.withAuthOptionalData(authOptionalData)
.createUrl();

partCount = (int) Math.ceil(totalSize * 1.d / UfileConstants.MULTIPART_SIZE);
partCount = (long) Math.ceil(totalSize * 1.d / UfileConstants.MULTIPART_SIZE);
JLog.E(TAG, "[partCount]:" + partCount);

switch (progressConfig.type) {
case PROGRESS_INTERVAL_TIME: {
Expand All @@ -287,9 +288,10 @@ protected void prepareData() throws UfileClientException {
bytesWrittenCache = new AtomicLong(0);

callList = new ArrayList<>();
for (int i = 0; i < partCount; i++) {
for (long i = 0L; i < partCount; i++) {
long start = Math.max(i * UfileConstants.MULTIPART_SIZE, rangeStart);
long end = Math.min(rangeEnd, (start + UfileConstants.MULTIPART_SIZE));
JLog.E(TAG, "[range]:" + String.format("bytes=%d-%d", start, end));
GetRequestBuilder builder = (GetRequestBuilder) new GetRequestBuilder()
.baseUrl(host)
.addHeader("Range", String.format("bytes=%d-%d", start, end));
Expand Down Expand Up @@ -495,9 +497,9 @@ public void run() {

private class DownloadCallable implements Callable<DownloadFileBean> {
private Call call;
private int index;
private long index;

public DownloadCallable(Call call, int index) {
public DownloadCallable(Call call, long index) {
this.call = call;
this.index = index;
}
Expand Down
4 changes: 2 additions & 2 deletions ufile/ufile-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<parent>
<groupId>cn.ucloud.ufile</groupId>
<artifactId>ufile</artifactId>
<version>2.6.5</version>
<version>2.6.6</version>
</parent>

<artifactId>ufile-core</artifactId>
<version>2.6.5</version>
<version>2.6.6</version>

<dependencies>
<dependency>
Expand Down