промежуточный. небольшой рефакторинг. наследие DBProjectFile от ProjectFile.
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
package SapforTestingSystem.Json;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Files.FileType;
|
||||
import com.google.gson.annotations.Expose;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Vector;
|
||||
public class SapforVersion_json implements Serializable {
|
||||
@Expose
|
||||
public String version = "";
|
||||
@Expose
|
||||
public String description = "";
|
||||
//поля для отображения деревьев.
|
||||
public File Home = null;
|
||||
public Vector<DBProjectFile> files = null;
|
||||
//-
|
||||
public SapforVersion_json(String version_in, String description_in) {
|
||||
version = version_in;
|
||||
description = description_in;
|
||||
@@ -21,11 +28,25 @@ public class SapforVersion_json implements Serializable {
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return Home.getName()+ " : "+ Utils.Brackets(description);
|
||||
return Home.getName() + " : " + Utils.Brackets(description);
|
||||
}
|
||||
public File Home = null;
|
||||
public void initHome(File configurationRoot) {
|
||||
public void init(File configurationRoot) {
|
||||
String relativePath = Global.isWindows ? Utils.toW(version) : version;
|
||||
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
|
||||
files = new Vector<>();
|
||||
//--
|
||||
File[] files_ = Home.listFiles();
|
||||
if (files_ != null) {
|
||||
for (File file: files_){
|
||||
if (file.isFile()) {
|
||||
DBProjectFile dbProjectFile = new DBProjectFile();
|
||||
dbProjectFile.file = file;
|
||||
dbProjectFile.AutoDetectProperties();
|
||||
if (dbProjectFile.fileType.equals(FileType.forbidden)) {
|
||||
files.add(dbProjectFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user