Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Dockerized Testing Toolkit
DTT Backend
Commits
3042e116
Verified
Commit
3042e116
authored
Dec 15, 2020
by
Lukas Wiest
🚂
Browse files
feat(util/FileUtil): add method for recursive folder copy
parent
13d3ce30
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/hftstuttgart/utils/FileUtil.java
View file @
3042e116
package
de.hftstuttgart.utils
;
import
java.io.File
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
/**
* Helper Class for all file related tasks.
...
...
@@ -27,4 +30,14 @@ public class FileUtil {
folder
.
delete
();
}
public
static
void
copyFolder
(
Path
src
,
Path
dst
)
throws
IOException
{
Files
.
walk
(
src
)
.
forEach
(
source
->
{
try
{
Files
.
copy
(
source
,
dst
.
resolve
(
src
.
relativize
(
source
)));
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
(),
e
);
}
});
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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