Skip to content

Commit

Permalink
#28259 Portable DBeaver product distribution (#29935)
Browse files Browse the repository at this point in the history
* #28259 Portable DBeaver product distribution

Fix for identify install location and configuration location

* #28259 Portable DBeaver product distribution

Fix location path

* #28259 Minor

* #28259 Minor

* #28259 Extra log disabled
  • Loading branch information
serjiokov committed May 13, 2024
1 parent 1457abe commit 177dc0e
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1778,21 +1778,33 @@ private URL getConfigurationLocation() {
}

/**
* Specific method for dbeaver products group designed to resolve product configuration location in
* common system place:
* ~/user/APP_DATA - WinOS
* ~/Library - MacOS
* ~/.local/share - Unix
* Specific method for Dbeaver products group to resolve product configuration
* location in<br>
* case of portable distribution (tar/zip) location used current location:
* <li>./configuration</><br>
* case of installation in system place:
* <li>~/user/APP_DATA - WinOS
* <li>~/Library - MacOS
* <li>~/.local/share - Unix
*
* @return url of location
*/
private URL buildProductURL() {
String productConfigurationLocation;
try {
URL installationUrl = new URL(getInstallLocation(), CONFIG_DIR);
if (checkConfigurationLocation(installationUrl)) {
return installationUrl;
}
} catch (Exception e) {
if (debug) {
System.out.println("Can not read product properties. " + e.getMessage()); //$NON-NLS-1$
}
}
String base = getWorkingDirectory(DBEAVER_DATA_FOLDER);
try {
String productPath = getProductProperties();
Path basePath = Paths.get(base, DBEAVER_INSTALL_FOLDER, productPath);
productConfigurationLocation = basePath.toFile().getAbsolutePath();
String productConfigurationLocation = basePath.toFile().getAbsolutePath();
return buildURL(productConfigurationLocation, true);
} catch (IOException e) {
if (debug)
Expand Down

0 comments on commit 177dc0e

Please sign in to comment.