Top Description Constructors Methods
org.jabref.gui.desktop.os

public Class DefaultDesktop

extends NativeDesktop
Class Inheritance
Annotations
@AllowedToUseAwt:Requires AWT to open a file
Imports
java.awt.Desktop, java.io.File, .IOException, java.nio.file.Path, org.jabref.Launcher, org.jabref.architecture.AllowedToUseAwt, org.jabref.gui.DialogService, org.jabref.preferences.FilePreferences, org.slf4j.LoggerFactory

This class contains some default implementations (if OS is neither linux, windows or osx) file directories and file/application open handling methods.

We cannot use a static logger instance here in this class as the Logger first needs to be configured in the Launcher#initLogging. The configuration of tinylog will become immutable as soon as the first log entry is issued.

See Also
https://tinylog.org/v2/configuration

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public Path
getApplicationDirectory()

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.getApplicationDirectory.

Returns the path to the system's applications folder.

public void
public void
openFile(String filePath, String fileType, FilePreferences filePreferences)

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFile.

public void
openFileWithApplication(String
The filename.
filePath
,
String
Link to the app that opens the file.
application
)

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFileWithApplication.

Opens a file on an Operating System, using the given application.

public void
Inherited from org.jabref.gui.desktop.os.NativeDesktop:
getBackupDirectorygetDefaultFileChooserDirectorygetFulltextIndexBaseDirectorygetHostNamegetLogDirectorygetSslDirectorygetUserDirectorymoveToTrashmoveToTrashSupported

Constructor Detail

DefaultDesktopback to summary
public DefaultDesktop()

Method Detail

detectProgramPathback to summary
public String detectProgramPath(String programName, String directoryName)

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.detectProgramPath.

Annotations
@Override
getApplicationDirectoryback to summary
public Path getApplicationDirectory()

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.getApplicationDirectory.

Doc from org.jabref.gui.desktop.os.NativeDesktop.getApplicationDirectory.

Returns the path to the system's applications folder.

Returns:Path

the path

Annotations
@Override
openConsoleback to summary
public void openConsole(String absolutePath, DialogService dialogService) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openConsole.

Annotations
@Override
openFileback to summary
public void openFile(String filePath, String fileType, FilePreferences filePreferences) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFile.

Annotations
@Override
openFileWithApplicationback to summary
public void openFileWithApplication(String filePath, String application) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFileWithApplication.

Doc from org.jabref.gui.desktop.os.NativeDesktop.openFileWithApplication.

Opens a file on an Operating System, using the given application.

Parameters
filePath:String

The filename.

application:String

Link to the app that opens the file.

Annotations
@Override
openFolderAndSelectFileback to summary
public void openFolderAndSelectFile(Path filePath) throws IOException

Implements abstract org.jabref.gui.desktop.os.NativeDesktop.openFolderAndSelectFile.

Annotations
@Override