Package io.github.jbastgen.stemma.app.io
Class FileOpener
java.lang.Object
io.github.jbastgen.stemma.app.io.FileOpener
Opens a file with the program the operating system has for it (feature 12):
open, xdg-open or
rundll32 url.dll,FileProtocolHandler, then java.awt.Desktop. Commands are started without a shell. Files that
can run as a program are recognised so the user can be asked first: a file from a repository may come from anybody.-
Method Summary
Modifier and TypeMethodDescriptioncommand(FileManager.Os os, Path file) The command that opens the file.static booleanisRunnable(Path file) Whether opening the file might run it: a known program or script type, or a file with the executable bit.static FileManager.Resultopen(FileManager.Os os, Path file, FileManager.Runner runner, WebBrowser.Browse fallback) Opens the file; blocks for at most a few seconds, so call it off the UI thread.static FileManager.ResultOpens the file on this computer.
-
Method Details
-
command
The command that opens the file. -
isRunnable
Whether opening the file might run it: a known program or script type, or a file with the executable bit. -
open
public static FileManager.Result open(FileManager.Os os, Path file, FileManager.Runner runner, WebBrowser.Browse fallback) Opens the file; blocks for at most a few seconds, so call it off the UI thread. -
open
Opens the file on this computer.
-