diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStore.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStore.java index d32bb423fe..9e13e85668 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStore.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStore.java @@ -89,18 +89,12 @@ public class FSGitRepoStore implements RepoStore { sourcePath, destinationPath ); - new ProcessBuilder( - "rm", "-rf", - destinationPath - ).start(); - Process copyProcess = new ProcessBuilder( - "cp", "-ra", - sourcePath, - destinationPath + "/" - ).start(); try { - copyProcess.waitFor(); - } catch (InterruptedException e) { + File source = new File(sourcePath); + File destination = new File(destinationPath); + FileUtils.deleteDirectory(destination); + FileUtils.copyDirectory(source, destination); + } catch (Exception e) { e.printStackTrace(); throw new IOException("copy failed" + e.getLocalizedMessage()); }