mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-30 02:08:58 -04: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() {
|
public static void printSystemLoad() {
|
||||||
Runtime runtime = Runtime.getRuntime();
|
Runtime runtime = Runtime.getRuntime();
|
||||||
long free = runtime.freeMemory() / 1024 / 1024;
|
long free = runtime.freeMemory() / 1024 / 1024;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue