Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
vadere
vadere
Commits
9ad30ee2
Commit
9ad30ee2
authored
Aug 22, 2018
by
Stefan Schuhbaeck
Browse files
fix util for recursive copy of test data
parent
d9c671aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
VadereSimulator/tests/org/vadere/simulator/projects/io/TestUtils.java
View file @
9ad30ee2
...
...
@@ -4,7 +4,6 @@ import org.vadere.util.io.RecursiveCopy;
import
java.io.File
;
import
java.io.IOException
;
import
java.net.URISyntaxException
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
...
...
@@ -12,18 +11,22 @@ import java.util.Comparator;
public
class
TestUtils
{
public
static
void
resetTestStructure
(
String
dest
,
String
backup
)
throws
URISyntaxException
{
public
static
void
copyDirTo
(
Path
source
,
Path
dest
)
{
try
{
if
(
Paths
.
get
(
dest
)
.
toFile
().
exists
())
{
Files
.
walk
(
Paths
.
get
(
dest
)
)
if
(
dest
.
toFile
().
exists
())
{
Files
.
walk
(
dest
)
.
sorted
(
Comparator
.
reverseOrder
())
.
map
(
Path:
:
toFile
)
.
forEach
(
File:
:
delete
);
}
Files
.
walkFileTree
(
Paths
.
get
(
backup
)
,
new
RecursiveCopy
(
backup
,
dest
));
Files
.
walkFileTree
(
source
,
new
RecursiveCopy
(
source
,
dest
));
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
public
static
void
copyDirTo
(
String
dest
,
String
backup
)
{
copyDirTo
(
Paths
.
get
(
dest
),
Paths
.
get
(
backup
));
}
}
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