Commit 2eb0ce9c authored by mamunozgil's avatar mamunozgil
Browse files

Merge branch 'amg-dev-volumes' of transfer.hft-stuttgart.de:cota/cota-backend into amg-dev-volumes

parents 2a4e7f82 18fbbd3b
Pipeline #10906 passed with stage
in 18 seconds
Showing with 25 additions and 19 deletions
+25 -19
......@@ -95,6 +95,12 @@ public class ExecuteTestUtil {
image = config.group(5);
}
// Log the paths before binding
LOG.debug("Binding paths for Docker container:");
LOG.debug("Test Path: {}", testPath);
LOG.debug("Source Path: {}", srcPath);
LOG.debug("Result Path: {}", resultPath);
// Start the test-container with professor-given image and submission-specific volume mounts
dockerUtil.runContainer(
image,
......
......@@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -42,23 +43,22 @@ public class FileUtil {
}
}
/**
* Copy the folder and its contents.
* @param src Source folder path
* @param dst Destination folder path
* @throws IOException if an I/O error occurs
*/
public static void copyFolder(Path src, Path dst) throws IOException {
Files.walk(src)
.forEach(source -> {
try {
Path destination = dst.resolve(src.relativize(source));
Files.copy(source, destination);
LOG.debug("Copying file from: {} to {}", source, destination);
} catch (IOException e) {
LOG.debug("Error copying file from: {} to {}", source, dst.resolve(src.relativize(source)), e);
throw new RuntimeException(e.getMessage(), e);
}
});
}
/**
* Copy the folder and its contents, overwriting existing files if they exist.
* @param src Source folder path
* @param dst Destination folder path
* @throws IOException if an I/O error occurs
*/
public static void copyFolder(Path src, Path dst) throws IOException {
Files.walk(src).forEach(source -> {
try {
Path destination = dst.resolve(src.relativize(source));
Files.copy(source, destination, StandardCopyOption.REPLACE_EXISTING);
LOG.debug("Successfully copied file from: {} to {}", source, destination);
} catch (IOException e) {
LOG.error("Error copying file from: {} to {}", source, dst.resolve(src.relativize(source)), e);
throw new RuntimeException(e.getMessage(), e);
}
});
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment