Skip to content

Commit

Permalink
Remove commons.io from FileDeployer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsuter committed Jul 29, 2024
1 parent 27ce6c7 commit b90c3fa
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
*/
package ch.ivyteam.ivy.maven.engine.deploy.dir;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Supplier;

import org.apache.commons.io.FileUtils;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;

Expand Down Expand Up @@ -71,21 +69,20 @@ private void clear() {
private void initDeployment() throws MojoExecutionException {
try {
if (deploymentOptionsFile != null) {
//var engineOption = deploymentFiles.getDeployCandidate().resolveSibling(deploymentOptionsFile.getName());
//Files.copy(deploymentOptionsFile.toPath(), engineOption);
File engineOption = new File(deploymentFiles.getDeployCandidate().getParent().toFile(), deploymentOptionsFile.getFileName().toString());
FileUtils.copyFile(deploymentOptionsFile.toFile(), engineOption);
var engineOption = deploymentFiles.getDeployCandidate().resolveSibling(deploymentOptionsFile.getFileName().toString());
Files.createDirectories(engineOption.getParent());
Files.copy(deploymentOptionsFile, engineOption);
}
} catch (IOException ex) {
throw new MojoExecutionException("Failed to initialize engine deployment, could not copy options file",
ex);
throw new MojoExecutionException("Failed to initialize engine deployment, could not copy options file", ex);
}
}

private void copyDeployableToEngine() throws MojoExecutionException {
try {
log.info("Uploading file " + deployFile + " to " + targetDeployableFile);
FileUtils.copyFile(deployFile.toFile(), targetDeployableFile.toFile());
Files.createDirectories(targetDeployableFile.getParent());
Files.copy(deployFile, targetDeployableFile);
} catch (IOException ex) {
throw new MojoExecutionException("Upload of file '" + deployFile.getFileName().toString() + "' to engine failed.", ex);
}
Expand Down

0 comments on commit b90c3fa

Please sign in to comment.