Skip to content

Commit

Permalink
Merge pull request #52 from JoshuaYin/master
Browse files Browse the repository at this point in the history
Release 2.6.6
  • Loading branch information
joshua.yin authored Nov 18, 2021
2 parents 3816dea + 05595a3 commit db147d2
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ build
*.iml
.classpath
.project
.settings/
.settings/
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @date: 2018/11/22 15:00
*/
public class UfileConstants {
public static final String SDK_VERSION = "2.6.5";
public static final String SDK_VERSION = "2.6.6";
/**
* 默认分片大小(4MB)
*/
Expand Down

0 comments on commit db147d2

Please sign in to comment.