RELATIONS.sequence10 : RELATIONS.commandRelation
@defCommandConnectionPoint "10"
+RELATIONS.sequence11 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "11"
+RELATIONS.sequence12 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "12"
+RELATIONS.sequence13 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "13"
+RELATIONS.sequence14 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "14"
+RELATIONS.sequence15 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "15"
+RELATIONS.sequence16 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "16"
+RELATIONS.sequence17 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "17"
+RELATIONS.sequence18 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "18"
+RELATIONS.sequence19 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "19"
+RELATIONS.sequence20 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "20"
+RELATIONS.sequence21 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "21"
+RELATIONS.sequence22 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "22"
+RELATIONS.sequence23 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "23"
+RELATIONS.sequence24 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "24"
+RELATIONS.sequence25 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "25"
+RELATIONS.sequence26 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "26"
+RELATIONS.sequence27 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "27"
+RELATIONS.sequence28 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "28"
+RELATIONS.sequence29 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "29"
+RELATIONS.sequence30 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "30"
+RELATIONS.sequence31 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "31"
+RELATIONS.sequence32 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "32"
+RELATIONS.sequence33 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "33"
+RELATIONS.sequence34 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "34"
+RELATIONS.sequence35 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "35"
+RELATIONS.sequence36 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "36"
+RELATIONS.sequence37 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "37"
+RELATIONS.sequence38 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "38"
+RELATIONS.sequence39 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "39"
+RELATIONS.sequence40 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "40"
+RELATIONS.sequence41 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "41"
+RELATIONS.sequence42 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "42"
+RELATIONS.sequence43 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "43"
+RELATIONS.sequence44 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "44"
+RELATIONS.sequence45 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "45"
+RELATIONS.sequence46 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "46"
+RELATIONS.sequence47 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "47"
+RELATIONS.sequence48 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "48"
+RELATIONS.sequence49 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "49"
+RELATIONS.sequence50 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "50"
+RELATIONS.sequence51 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "51"
+RELATIONS.sequence52 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "52"
+RELATIONS.sequence53 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "53"
+RELATIONS.sequence54 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "54"
+RELATIONS.sequence55 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "55"
+RELATIONS.sequence56 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "56"
+RELATIONS.sequence57 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "57"
+RELATIONS.sequence58 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "58"
+RELATIONS.sequence59 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "59"
+RELATIONS.sequence60 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "60"
+RELATIONS.sequence61 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "61"
+RELATIONS.sequence62 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "62"
+RELATIONS.sequence63 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "63"
+RELATIONS.sequence64 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "64"
+RELATIONS.sequence65 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "65"
+RELATIONS.sequence66 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "66"
+RELATIONS.sequence67 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "67"
+RELATIONS.sequence68 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "68"
+RELATIONS.sequence69 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "69"
+RELATIONS.sequence70 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "70"
+RELATIONS.sequence71 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "71"
+RELATIONS.sequence72 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "72"
+RELATIONS.sequence73 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "73"
+RELATIONS.sequence74 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "74"
+RELATIONS.sequence75 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "75"
+RELATIONS.sequence76 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "76"
+RELATIONS.sequence77 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "77"
+RELATIONS.sequence78 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "78"
+RELATIONS.sequence79 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "79"
+RELATIONS.sequence80 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "80"
+RELATIONS.sequence81 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "81"
+RELATIONS.sequence82 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "82"
+RELATIONS.sequence83 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "83"
+RELATIONS.sequence84 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "84"
+RELATIONS.sequence85 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "85"
+RELATIONS.sequence86 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "86"
+RELATIONS.sequence87 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "87"
+RELATIONS.sequence88 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "88"
+RELATIONS.sequence89 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "89"
+RELATIONS.sequence90 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "90"
+RELATIONS.sequence91 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "91"
+RELATIONS.sequence92 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "92"
+RELATIONS.sequence93 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "93"
+RELATIONS.sequence94 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "94"
+RELATIONS.sequence95 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "95"
+RELATIONS.sequence96 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "96"
+RELATIONS.sequence97 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "97"
+RELATIONS.sequence98 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "98"
+RELATIONS.sequence99 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "99"
+RELATIONS.sequence100 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "100"
+RELATIONS.sequence101 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "101"
+RELATIONS.sequence102 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "102"
+RELATIONS.sequence103 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "103"
+RELATIONS.sequence104 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "104"
+RELATIONS.sequence105 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "105"
+RELATIONS.sequence106 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "106"
+RELATIONS.sequence107 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "107"
+RELATIONS.sequence108 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "108"
+RELATIONS.sequence109 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "109"
+RELATIONS.sequence110 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "110"
+RELATIONS.sequence111 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "111"
+RELATIONS.sequence112 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "112"
+RELATIONS.sequence113 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "113"
+RELATIONS.sequence114 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "114"
+RELATIONS.sequence115 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "115"
+RELATIONS.sequence116 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "116"
+RELATIONS.sequence117 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "117"
+RELATIONS.sequence118 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "118"
+RELATIONS.sequence119 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "119"
+RELATIONS.sequence120 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "120"
+RELATIONS.sequence121 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "121"
+RELATIONS.sequence122 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "122"
+RELATIONS.sequence123 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "123"
+RELATIONS.sequence124 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "124"
+RELATIONS.sequence125 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "125"
+RELATIONS.sequence126 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "126"
+RELATIONS.sequence127 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "127"
+RELATIONS.sequence128 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "128"
+RELATIONS.sequence129 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "129"
+RELATIONS.sequence130 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "130"
+RELATIONS.sequence131 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "131"
+RELATIONS.sequence132 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "132"
+RELATIONS.sequence133 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "133"
+RELATIONS.sequence134 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "134"
+RELATIONS.sequence135 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "135"
+RELATIONS.sequence136 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "136"
+RELATIONS.sequence137 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "137"
+RELATIONS.sequence138 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "138"
+RELATIONS.sequence139 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "139"
+RELATIONS.sequence140 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "140"
+RELATIONS.sequence141 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "141"
+RELATIONS.sequence142 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "142"
+RELATIONS.sequence143 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "143"
+RELATIONS.sequence144 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "144"
+RELATIONS.sequence145 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "145"
+RELATIONS.sequence146 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "146"
+RELATIONS.sequence147 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "147"
+RELATIONS.sequence148 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "148"
+RELATIONS.sequence149 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "149"
+RELATIONS.sequence150 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "150"
+RELATIONS.sequence151 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "151"
+RELATIONS.sequence152 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "152"
+RELATIONS.sequence153 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "153"
+RELATIONS.sequence154 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "154"
+RELATIONS.sequence155 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "155"
+RELATIONS.sequence156 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "156"
+RELATIONS.sequence157 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "157"
+RELATIONS.sequence158 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "158"
+RELATIONS.sequence159 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "159"
+RELATIONS.sequence160 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "160"
+RELATIONS.sequence161 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "161"
+RELATIONS.sequence162 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "162"
+RELATIONS.sequence163 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "163"
+RELATIONS.sequence164 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "164"
+RELATIONS.sequence165 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "165"
+RELATIONS.sequence166 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "166"
+RELATIONS.sequence167 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "167"
+RELATIONS.sequence168 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "168"
+RELATIONS.sequence169 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "169"
+RELATIONS.sequence170 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "170"
+RELATIONS.sequence171 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "171"
+RELATIONS.sequence172 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "172"
+RELATIONS.sequence173 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "173"
+RELATIONS.sequence174 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "174"
+RELATIONS.sequence175 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "175"
+RELATIONS.sequence176 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "176"
+RELATIONS.sequence177 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "177"
+RELATIONS.sequence178 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "178"
+RELATIONS.sequence179 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "179"
+RELATIONS.sequence180 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "180"
+RELATIONS.sequence181 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "181"
+RELATIONS.sequence182 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "182"
+RELATIONS.sequence183 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "183"
+RELATIONS.sequence184 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "184"
+RELATIONS.sequence185 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "185"
+RELATIONS.sequence186 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "186"
+RELATIONS.sequence187 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "187"
+RELATIONS.sequence188 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "188"
+RELATIONS.sequence189 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "189"
+RELATIONS.sequence190 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "190"
+RELATIONS.sequence191 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "191"
+RELATIONS.sequence192 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "192"
+RELATIONS.sequence193 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "193"
+RELATIONS.sequence194 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "194"
+RELATIONS.sequence195 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "195"
+RELATIONS.sequence196 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "196"
+RELATIONS.sequence197 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "197"
+RELATIONS.sequence198 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "198"
+RELATIONS.sequence199 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "199"
+RELATIONS.sequence200 : RELATIONS.commandRelation
+ @defCommandConnectionPoint "200"
+
RELATIONS.broadcasted : RELATIONS.commandRelation
@defCommandConnectionPoint "1"
package org.simantics;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
+import org.eclipse.core.runtime.Platform;
import org.simantics.utils.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
private static final DateTimeFormatter TIMESTAMP_FORMAT = DateTimeFormatter.ofPattern("d. MMM yyyy HH:mm:ss");
- public static Path packageBaseline(Path fromWorkspace, Path packageFile) throws IOException {
- return compressZip(fromWorkspace, collectBaselinePaths(fromWorkspace), packageFile);
+ public static boolean handleBaselineDatabase(Path installLocation, boolean databaseExists) throws PlatformException {
+ Path workspaceLocation = Platform.getLocation().toFile().toPath();
+ Path baselineIndicatorFile = workspaceLocation.resolve(".baselined");
+ if (Files.isRegularFile(baselineIndicatorFile)) {
+ // This means that the workspace has already been initialized from
+ // a database baseline and further initialization is not necessary.
+ return true;
+ }
+
+ Path baseline = resolveBaselineFile(installLocation);
+ if (baseline == null) {
+ baseline = getAutomaticBaselinePath();
+ if(baseline == null)
+ return false;
+ if(databaseExists)
+ return false;
+ if(!existsAutomaticBaseline())
+ return false;
+ }
+
+ DatabaseBaselines.validateBaselineFile(baseline);
+ DatabaseBaselines.validateWorkspaceForBaselineInitialization(workspaceLocation);
+ DatabaseBaselines.initializeWorkspaceWithBaseline(baseline, workspaceLocation, baselineIndicatorFile);
+ return true;
+
+ }
+
+ private static Path resolveBaselineFile(Path installLocation) throws PlatformException {
+ String dbBaselineArchive = System.getProperty("org.simantics.db.baseline", null);
+ if (dbBaselineArchive == null)
+ return null;
+
+ Path baseline = Paths.get(dbBaselineArchive);
+ if (baseline.isAbsolute()) {
+ if (!Files.isRegularFile(baseline))
+ throw new PlatformException("Specified database baseline archive " + baseline
+ + " does not exist. Cannot initialize workspace database from baseline.");
+ return baseline;
+ }
+
+ // Relative path resolution order:
+ // 1. from the platform "install location"
+ // 2. from working directory
+ //Path installLocation = tryGetInstallLocation();
+ if (installLocation != null) {
+ Path installedBaseline = installLocation.resolve(dbBaselineArchive);
+ if (Files.isRegularFile(installedBaseline))
+ return installedBaseline;
+ }
+ if (!Files.isRegularFile(baseline))
+ throw new PlatformException("Specified database baseline archive " + baseline
+ + " does not exist in either the install location (" + installLocation
+ + ") or the working directory (" + Paths.get(".").toAbsolutePath()
+ + "). Cannot initialize workspace database.");
+ return null;
+ }
+
+ private static boolean useAutomaticBaseline() {
+ return getAutomaticBaselinePath() != null;
+ }
+
+ private static Path getAutomaticBaselinePath() {
+ if("true".equals(System.getProperty("org.simantics.db.baseline.automatic")))
+ return Paths.get("automatic_baseline", "baseline.zip");
+ else
+ return null;
+ }
+
+ private static boolean existsAutomaticBaseline() {
+ Path baselineFile = getAutomaticBaselinePath();
+ if(baselineFile == null)
+ return false;
+ return Files.exists(baselineFile);
+ }
+
+ public static boolean shouldCreateAutomaticBaseline(boolean existsDatabase) throws PlatformException {
+ if(!useAutomaticBaseline()) {
+ // Are we using this feature?
+ return false;
+ }
+ if(existsDatabase) {
+ // Baseline can only be created after db initialization
+ return false;
+ }
+ if(existsAutomaticBaseline()) {
+ // Existing baselines should not be automatically overridden
+ return false;
+ }
+ return true;
+ }
+
+ public static void createAutomaticBaseline(Path dbLocation) throws PlatformException {
+
+ if(existsAutomaticBaseline())
+ return;
+
+ try {
+ DatabaseBaselines.packageBaseline(dbLocation.getParent(), getAutomaticBaselinePath());
+ } catch (IOException e) {
+ LOGGER.error("Error while creating automatic baseline", e);
+ }
+
+ }
+
+ public static Path packageBaseline(Path fromWorkspace, Path packageFilePath) throws IOException {
+ File packageFile = packageFilePath.toFile();
+ packageFile.getParentFile().mkdirs();
+ return compressZip(fromWorkspace, collectBaselinePaths(fromWorkspace), packageFilePath);
}
private static List<Path> collectBaselinePaths(Path workspace) throws IOException {