Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CoTA
cota-backend
Commits
18fbbd3b
Commit
18fbbd3b
authored
2 months ago
by
mamunozgil
Browse files
Options
Download
Email Patches
Plain Diff
Overrwrite and debug added
parent
49f19419
Pipeline
#10905
passed with stage
in 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/hftstuttgart/dtabackend/utils/ExecuteTestUtil.java
+6
-0
...ava/de/hftstuttgart/dtabackend/utils/ExecuteTestUtil.java
src/main/java/de/hftstuttgart/dtabackend/utils/FileUtil.java
+19
-19
src/main/java/de/hftstuttgart/dtabackend/utils/FileUtil.java
with
25 additions
and
19 deletions
+25
-19
src/main/java/de/hftstuttgart/dtabackend/utils/ExecuteTestUtil.java
+
6
-
0
View file @
18fbbd3b
...
@@ -95,6 +95,12 @@ public class ExecuteTestUtil {
...
@@ -95,6 +95,12 @@ public class ExecuteTestUtil {
image
=
config
.
group
(
5
);
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
// Start the test-container with professor-given image and submission-specific volume mounts
dockerUtil
.
runContainerWithBinds
(
dockerUtil
.
runContainerWithBinds
(
image
,
image
,
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/hftstuttgart/dtabackend/utils/FileUtil.java
+
19
-
19
View file @
18fbbd3b
...
@@ -4,6 +4,7 @@ import java.io.File;
...
@@ -4,6 +4,7 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.StandardCopyOption
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -42,23 +43,22 @@ public class FileUtil {
...
@@ -42,23 +43,22 @@ public class FileUtil {
}
}
}
}
/**
/**
* Copy the folder and its contents.
* Copy the folder and its contents, overwriting existing files if they exist.
* @param src Source folder path
* @param src Source folder path
* @param dst Destination folder path
* @param dst Destination folder path
* @throws IOException if an I/O error occurs
* @throws IOException if an I/O error occurs
*/
*/
public
static
void
copyFolder
(
Path
src
,
Path
dst
)
throws
IOException
{
public
static
void
copyFolder
(
Path
src
,
Path
dst
)
throws
IOException
{
Files
.
walk
(
src
)
Files
.
walk
(
src
).
forEach
(
source
->
{
.
forEach
(
source
->
{
try
{
try
{
Path
destination
=
dst
.
resolve
(
src
.
relativize
(
source
));
Path
destination
=
dst
.
resolve
(
src
.
relativize
(
source
));
Files
.
copy
(
source
,
destination
,
StandardCopyOption
.
REPLACE_EXISTING
);
Files
.
copy
(
source
,
destination
);
LOG
.
debug
(
"Successfully copied file from: {} to {}"
,
source
,
destination
);
LOG
.
debug
(
"Copying file from: {} to {}"
,
source
,
destination
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
LOG
.
error
(
"Error copying file from: {} to {}"
,
source
,
dst
.
resolve
(
src
.
relativize
(
source
)),
e
);
LOG
.
debug
(
"Error copying file from: {} to {}"
,
source
,
dst
.
resolve
(
src
.
relativize
(
source
)),
e
);
throw
new
RuntimeException
(
e
.
getMessage
(),
e
);
throw
new
RuntimeException
(
e
.
getMessage
(),
e
);
}
}
});
});
}
}
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets