no message
This commit is contained in:
@@ -2,6 +2,7 @@ package SapforTestingSystem.Json;
|
||||
import Common.Constants;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Files.FileState;
|
||||
import ProjectData.Files.FileType;
|
||||
import ProjectData.Files.ProjectFile;
|
||||
import com.google.gson.annotations.Expose;
|
||||
@@ -9,6 +10,7 @@ import com.google.gson.annotations.Expose;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class SapforVersion_json implements Serializable {
|
||||
@Expose
|
||||
@@ -18,7 +20,7 @@ public class SapforVersion_json implements Serializable {
|
||||
public boolean success = true;
|
||||
//поля для отображения деревьев.
|
||||
public File Home = null;
|
||||
public Vector<ProjectFile> files = null;
|
||||
public LinkedHashMap<String, ProjectFile> files = new LinkedHashMap<>();
|
||||
//-
|
||||
public SapforVersion_json(String version_in, String description_in) {
|
||||
version = version_in;
|
||||
@@ -35,15 +37,17 @@ public class SapforVersion_json implements Serializable {
|
||||
public void init(File configurationRoot) {
|
||||
String relativePath = Global.isWindows ? Utils.toW(version) : version;
|
||||
Home = Paths.get(configurationRoot.getAbsolutePath(), relativePath).toFile();
|
||||
files = new Vector<>();
|
||||
files = new LinkedHashMap<>();
|
||||
//--
|
||||
File[] files_ = Home.listFiles();
|
||||
if (files_ != null) {
|
||||
for (File file : files_) {
|
||||
if (file.isFile()) {
|
||||
ProjectFile projectFile = new ProjectFile(file);
|
||||
if (!projectFile.fileType.equals(FileType.forbidden)) {
|
||||
files.add(projectFile);
|
||||
if (!projectFile.fileType.equals(FileType.forbidden) &&
|
||||
!projectFile.state.equals(FileState.Excluded)
|
||||
) {
|
||||
files.put(projectFile.file.getName(), projectFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,10 +61,25 @@ public class SapforVersion_json implements Serializable {
|
||||
//--
|
||||
for (File file : out_files) {
|
||||
if (file.exists()) {
|
||||
// System.out.println(file.getAbsolutePath());
|
||||
// System.out.println(file.getAbsolutePath());
|
||||
ProjectFile projectFile = new ProjectFile(file);
|
||||
files.add(projectFile);
|
||||
files.put(projectFile.file.getName(), projectFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean isMatch(SapforVersion_json version_json) {
|
||||
if (!version.equals(version_json.version)) {
|
||||
System.out.println("не совпадение имени версии");
|
||||
return false;
|
||||
}
|
||||
if (description.equals(version_json.description)) {
|
||||
System.out.println("не совпадение описания версии");
|
||||
return false;
|
||||
}
|
||||
if (files.size() != version_json.files.size()) {
|
||||
System.out.println("не совпадение количества файлов");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user