Skip to content

Commit

Permalink
fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodWorkXGaming committed Jun 10, 2018
1 parent ad83c83 commit a330980
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package atm.bloodworkxgaming.serverstarter;

import atm.bloodworkxgaming.serverstarter.config.AddionalFile;
import atm.bloodworkxgaming.serverstarter.config.AdditionalFile;
import atm.bloodworkxgaming.serverstarter.config.ConfigFile;
import atm.bloodworkxgaming.serverstarter.config.LocalFile;
import org.apache.commons.io.FileUtils;
Expand All @@ -19,24 +19,24 @@

public class FileManager {
public ConfigFile configFile;
public List<AddionalFile> addionalFiles;
public List<AdditionalFile> additionalFiles;

public FileManager(ConfigFile configFile) {
this.configFile = configFile;
addionalFiles = configFile.install.additionalFiles != null ? configFile.install.additionalFiles : Collections.emptyList();
additionalFiles = configFile.install.additionalFiles != null ? configFile.install.additionalFiles : Collections.emptyList();
}

public void installAdditionalFiles() {
LOGGER.info("Starting to installing Additional Files");
List<AddionalFile> fallbackList = new ArrayList<>();
addionalFiles.parallelStream().forEach(file -> handleAdditionalFile(file, fallbackList));
List<AdditionalFile> fallbackList = new ArrayList<>();
additionalFiles.parallelStream().forEach(file -> handleAdditionalFile(file, fallbackList));

List<AddionalFile> failList = new ArrayList<>();
List<AdditionalFile> failList = new ArrayList<>();

fallbackList.parallelStream().forEach(file -> handleAdditionalFile(file, failList));
}

private void handleAdditionalFile(AddionalFile file, List<AddionalFile> fallbackList) {
private void handleAdditionalFile(AdditionalFile file, List<AdditionalFile> fallbackList) {
LOGGER.info("Starting to download " + file);
try {
FileUtils.copyURLToFile(cleanUrl(file.url), new File(configFile.install.baseInstallPath + file.destination));
Expand All @@ -52,7 +52,7 @@ private void handleAdditionalFile(AddionalFile file, List<AddionalFile> fallback
public void installLocalFiles() {
LOGGER.info("Starting to copy local files.");
for (LocalFile localFile : configFile.install.localFiles) {
LOGGER.info("Copying localfile: " + localFile);
LOGGER.info("Copying local file: " + localFile);
try {
FileUtils.copyFile(new File(localFile.from), new File(localFile.to));
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@EqualsAndHashCode
@ToString
public class AddionalFile {
public class AdditionalFile {
public String url;
public String destination;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class InstallConfig {

public String baseInstallPath;
public List<String> ignoreFiles;
public List<AddionalFile> additionalFiles;
public List<AdditionalFile> additionalFiles;
public List<LocalFile> localFiles;

public boolean checkFolder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private void downloadMods(List<ModEntryRaw> mods) {

/**
* Downloads all mods, with a second fallback if failed
* This is done in parrallel for better performance
* This is done in parallel for better performance
*
* @param mods List of urls
*/
Expand Down

0 comments on commit a330980

Please sign in to comment.