mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-16 20:26:02 +00:00
ensure path is always absolute
Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
@@ -23,10 +23,11 @@ public class JfxRevealPathService implements RevealPathService {
|
||||
|
||||
@Override
|
||||
public void reveal(Path p) throws RevealFailedException {
|
||||
var absPath = p.toAbsolutePath();
|
||||
var fxApp = FxApplication.INSTANCE.get();
|
||||
if (fxApp != null) {
|
||||
// showDocument() launches the default app for a regular file, so reveal its parent directory instead
|
||||
var target = Files.isRegularFile(p) ? p.getParent() : p;
|
||||
var target = Files.isRegularFile(absPath) ? absPath.getParent() : absPath;
|
||||
fxApp.getHostServices().showDocument(target.toUri().toString());
|
||||
} else {
|
||||
throw new RevealFailedException("JavaFX Application not initialized");
|
||||
|
||||
Reference in New Issue
Block a user