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

public Class DefaultDesktop

extends NativeDesktop
Class Inheritance
Annotations
@org.jabref.architecture.AllowedToUseAwt
Imports
java.awt.Desktop, java.io.File, .IOException, java.nio.file.Path, org.jabref.architecture.AllowedToUseAwt, org.jabref.gui.DialogService, org.jabref.gui.frame.ExternalApplicationsPreferences, org.jabref.logic.util.Directories, 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 JabKit#initLogging. The configuration of tinylog will become immutable as soon as the first log entry is issued. See https://tinylog.org/v2/configuration/.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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, ExternalApplicationsPreferences externalApplicationsPreferences)

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

public void
openFileWithApplication(String filePath, String application)

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

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

public void
public void
openUrlWithSystemHandler(String url)

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

Hands the URL string, unmodified, to the OS's URL-aware handler.

Inherited from org.jabref.gui.desktop.os.NativeDesktop:
desktopBrowsegetgetDefaultFileChooserDirectorymoveToTrashmoveToTrashSupportedopenBrowseropenBrowseropenBrowseropenBrowseropenBrowserShowPopupopenConsoleopenCustomDoiopenExternalFileAnyFormatopenExternalVieweropenFolderAndSelectFilesupportsDesktopBrowse

Constructor Detail

DefaultDesktopback to summary
public DefaultDesktop()

Method Detail

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.

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, ExternalApplicationsPreferences externalApplicationsPreferences) 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.

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

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

Annotations
@Override
openUrlWithSystemHandlerback to summary
public void openUrlWithSystemHandler(String url) throws IOException

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

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

Hands the URL string, unmodified, to the OS's URL-aware handler. Used when Desktop.browse is unsupported, not applicable, or failed; the URL must never be run through Path.of, which mangles it.

Annotations
@Override