mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Add open directory method
This commit is contained in:
parent
9d265d8914
commit
d0e4792094
1 changed files with 17 additions and 0 deletions
|
@ -144,6 +144,23 @@ public class Utilities {
|
|||
}
|
||||
}
|
||||
|
||||
public static void openDirectory(File directory) throws IOException {
|
||||
if (!isLinux()
|
||||
&& Desktop.isDesktopSupported()
|
||||
&& Desktop.getDesktop().isSupported(Desktop.Action.OPEN)) {
|
||||
Desktop.getDesktop().open(directory);
|
||||
} else {
|
||||
// Maybe Application.HostServices works in those cases?
|
||||
// HostServices hostServices = getHostServices();
|
||||
// hostServices.showDocument(uri.toString());
|
||||
|
||||
// On Linux Desktop is poorly implemented.
|
||||
// See https://stackoverflow.com/questions/18004150/desktop-api-is-not-supported-on-the-current-platform
|
||||
if (!DesktopUtil.open(directory))
|
||||
throw new IOException("Failed to open directory: " + directory.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public static void printSystemLoad() {
|
||||
Runtime runtime = Runtime.getRuntime();
|
||||
long free = runtime.freeMemory() / 1024 / 1024;
|
||||
|
|
Loading…
Add table
Reference in a new issue