v++
доделал копирование папок для тестов. не было учтено наличие подверсий.
This commit is contained in:
@@ -88,7 +88,18 @@ public class Test extends riDBObject {
|
||||
File tempArchive = getTempArchive();
|
||||
//- создать бд.
|
||||
FileUtils.forceMkdir(tempProject);
|
||||
FileUtils.copyDirectory(dir, tempProject);
|
||||
File[] files = dir.listFiles();
|
||||
if (files == null)
|
||||
throw new PassException("Не удалось получить список файлов папки " + Utils.Brackets(dir));
|
||||
//--
|
||||
//предполагается, что тут уже нет вложенных подпапок кроме версий. поэтому копируем только файлы.
|
||||
for (File file : files) {
|
||||
if (file.isFile()) {
|
||||
System.out.println(file.getAbsolutePath());
|
||||
File dst = new File(tempProject, file.getName());
|
||||
FileUtils.copyFile(file, dst);
|
||||
}
|
||||
}
|
||||
//---
|
||||
Utils.ClearProjectData(tempProject);
|
||||
//--
|
||||
@@ -134,8 +145,7 @@ public class Test extends riDBObject {
|
||||
public String getFilesForTable() {
|
||||
return files.replace("\n", ";");
|
||||
}
|
||||
|
||||
public LinkedHashMap<LanguageName, Vector<ProjectFile>> getPrograms(){
|
||||
public LinkedHashMap<LanguageName, Vector<ProjectFile>> getPrograms() {
|
||||
LinkedHashMap<LanguageName, Vector<ProjectFile>> res = new LinkedHashMap<>();
|
||||
//--
|
||||
res.put(LanguageName.fortran, new Vector<>());
|
||||
@@ -143,7 +153,7 @@ public class Test extends riDBObject {
|
||||
res.put(LanguageName.cpp, new Vector<>());
|
||||
//--
|
||||
String[] files_names = files.split("\n");
|
||||
for (String file_name: files_names){
|
||||
for (String file_name : files_names) {
|
||||
ProjectFile file = new ProjectFile(new File(file_name));
|
||||
//--
|
||||
if (!file.state.equals(FileState.Excluded) &&
|
||||
@@ -153,5 +163,4 @@ public class Test extends riDBObject {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user