Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/0.6.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
UndeadZeratul committed Oct 8, 2020
2 parents 1e11dd7 + 8fcccb6 commit b39922a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion modpackdownloader-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.nincraft</groupId>
<artifactId>modpackdownloader</artifactId>
<version>0.6</version>
<version>0.6.1</version>
</parent>

<artifactId>modpackdownloader-cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modpackdownloader-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.nincraft</groupId>
<artifactId>modpackdownloader</artifactId>
<version>0.6</version>
<version>0.6.1</version>
</parent>

<artifactId>modpackdownloader-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import java.io.IOException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Observable;

@Log4j2
Expand Down Expand Up @@ -51,26 +50,19 @@ public DownloadStatus downloadFile(final DownloadableFile downloadableFile, bool
log.debug("Skipped downloading {}", downloadableFile.getName());
return notifyStatus(DownloadStatus.SKIPPED);
}
String decodedFileName;
String fileName = downloadableFile.getFileName();

try {
decodedFileName = URLDecoder.decode(downloadableFile.getFileName(), "UTF-8");
} catch (final IOException e) {
log.error("Error Decoding Filename: {}", downloadableFile.getFileName(), e);
return notifyStatus(DownloadStatus.FAILURE);
}

if (FileSystemHelper.getDownloadedFile(decodedFileName, downloadableFile.getFolder()).exists() && !arguments.isForceDownload()) {
log.debug("Found {} already downloaded, skipping", decodedFileName);
if (FileSystemHelper.getDownloadedFile(fileName, downloadableFile.getFolder()).exists() && !arguments.isForceDownload()) {
log.debug("Found {} already downloaded, skipping", fileName);
return notifyStatus(DownloadStatus.SKIPPED);
}

if (!FileSystemHelper.isInLocalRepo(downloadableFile.getName(), decodedFileName) || arguments.isForceDownload()) {
if (!FileSystemHelper.isInLocalRepo(downloadableFile.getName(), fileName) || arguments.isForceDownload()) {
val downloadedFile = FileSystemHelper.getLocalFile(downloadableFile);
try {
FileUtils.copyURLToFile(new URL(downloadableFile.getDownloadUrl()), downloadedFile);
} catch (final IOException e) {
log.error("Could not download {}.", downloadableFile.getFileName(), e);
log.error("Could not download {}.", fileName, e);
Reference.downloadCount++;
if ("forge".equals(downloadableFile.getName())) {
return status;
Expand All @@ -81,8 +73,8 @@ public DownloadStatus downloadFile(final DownloadableFile downloadableFile, bool
} else {
status = DownloadStatus.SUCCESS_CACHE;
}
FileSystemHelper.moveFromLocalRepo(downloadableFile, decodedFileName, downloadToLocalRepo, arguments.getModFolder());
log.info("Successfully {} {}", status, downloadableFile.getFileName());
FileSystemHelper.moveFromLocalRepo(downloadableFile, fileName, downloadToLocalRepo, arguments.getModFolder());
log.info("Successfully {} {}", status, fileName);
return notifyStatus(status);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public void cleanUp() throws IOException {
FileUtils.copyFile(backupUpdate, updateFile);
}

@Ignore
@Test
public void testDownloadRelease() throws InterruptedException {
ModpackDownloaderManager manager = new ModpackDownloaderManager(new String[]{"-manifest", RESOURCES + "download-test.json", "-releaseType", "release", "-forceDownload"});
Expand All @@ -58,6 +59,7 @@ public void testDownloadRelease() throws InterruptedException {
}
}

@Ignore
@Test
public void testDownloadMaxThreads() throws InterruptedException {
ModpackDownloaderManager manager = new ModpackDownloaderManager(new String[]{"-manifest", RESOURCES + "download-test.json", "-maxDownloadThreads", "1"});
Expand Down
2 changes: 1 addition & 1 deletion modpackdownloader-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.nincraft</groupId>
<artifactId>modpackdownloader</artifactId>
<version>0.6</version>
<version>0.6.1</version>
</parent>

<artifactId>modpackdownloader-gui</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion modpackdownloader-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.nincraft</groupId>
<artifactId>modpackdownloader</artifactId>
<version>0.6</version>
<version>0.6.1</version>
</parent>

<artifactId>modpackdownloader-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.nincraft</groupId>
<artifactId>modpackdownloader</artifactId>
<version>0.6</version>
<version>0.6.1</version>
<packaging>pom</packaging>

<name>Modpack Downloader</name>
Expand Down

0 comments on commit b39922a

Please sign in to comment.