no message
This commit is contained in:
41
src/_VisualDVM/Passes/All/DownloadRepository.java
Normal file
41
src/_VisualDVM/Passes/All/DownloadRepository.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.Passes.ProcessPass;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Paths;
|
||||
public class DownloadRepository extends ProcessPass {
|
||||
File dvmHome;
|
||||
File sapforHome;
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
dvmHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"dvm").toFile();
|
||||
sapforHome = Paths.get(Global.RepoDirectory.getAbsolutePath(),
|
||||
"sapfor").toFile();
|
||||
return true;
|
||||
}
|
||||
private void synchronize(String src, File dst) throws Exception {
|
||||
File loadedFile = Paths.get(dst.getAbsolutePath(), Constants.LOADED).toFile();
|
||||
if (loadedFile.exists()) {
|
||||
PerformScript("cd " +
|
||||
dst.getAbsolutePath() +
|
||||
"\nsvn update " + Constants.REPOSITORY_AUTHENTICATION + "\n");
|
||||
} else {
|
||||
Utils.CleanDirectory(dst);
|
||||
PerformScript("cd Repo\nsvn checkout " + Constants.REPOSITORY_AUTHENTICATION + " " + src + "\n"); //export
|
||||
FileUtils.write(loadedFile, "");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
ShowProgress(2, 0, true);
|
||||
synchronize(Constants.DVM_REPOSITORY, dvmHome);
|
||||
ShowProgress(2, 1, true);
|
||||
synchronize(Constants.SAPFOR_REPOSITORY, sapforHome);
|
||||
ShowProgress(2, 2, true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user