Skip to content

Commit 0a5ea22

Browse files
refactor: convert file to path, and then to uri; this correctly results in the system-independent file:// path
1 parent ed7e3be commit 0a5ea22

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/AttachmentsPreviewController.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ public void changed(ObservableValue<? extends Attachment> observable, Attachment
130130
// If there is no app configured for the file type, then use the default configured for the OS/User
131131
// Note: Do not use Desktop API, as using Java AWT can hang Phoebus / JavaFX Applications
132132
try {
133-
PhoebusApplication.INSTANCE.getHostServices().showDocument(
134-
attachment.getFile().toURI().getRawPath()
135-
);
133+
String filePathString = attachment.getFile().toPath().toUri().toString();
134+
PhoebusApplication.INSTANCE.getHostServices().showDocument(filePathString);
136135
} catch (Exception e) {
137136
ExceptionDetailsErrorDialog.openError(Messages.PreviewOpenErrorTitle, Messages.PreviewOpenErrorBody, null);
138137
}

0 commit comments

Comments
 (0)