- private static final DateTimeFormatter TIMESTAMP_FORMAT = DateTimeFormatter.ofPattern("d. MMM yyyy HH:mm:ss");
-
- private static byte[] baselineIndicatorContents(Path path) throws IOException {
- return String.format("%s%n%s%n",
- path.toString(),
- Instant.now().atZone(ZoneId.systemDefault()).format(TIMESTAMP_FORMAT))
- .getBytes("UTF-8");
+ // 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;