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

public Class Linux

extends NativeDesktop
Class Inheritance
Annotations
@org.jabref.architecture.AllowedToUseAwt
Imports
java.awt.Desktop, java.io.BufferedReader, .File, .IOException, .InputStreamReader, java.nio.charset.StandardCharsets, java.nio.file.Files, .Path, java.util.List, .Locale, .Optional, org.jabref.architecture.AllowedToUseAwt, org.jabref.gui.DialogService, org.jabref.gui.externalfiletype.ExternalFileType, .ExternalFileTypes, org.jabref.gui.frame.ExternalApplicationsPreferences, org.jabref.logic.l10n.Localization, org.jabref.logic.util.Directories, .HeadlessExecutorService, .StreamGobbler, org.slf4j.LoggerFactory

This class contains Linux specific implementations for 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. https://tinylog.org/v2/configuration

Field Summary

Modifier and TypeField and Description
private static final String

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 Path
private void
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:
desktopBrowsegetmoveToTrashmoveToTrashSupportedopenBrowseropenBrowseropenBrowseropenBrowseropenBrowserShowPopupopenConsoleopenCustomDoiopenExternalFileAnyFormatopenExternalVieweropenFolderAndSelectFilesupportsDesktopBrowse

Field Detail

ETC_ALTERNATIVES_X_TERMINAL_EMULATORback to summary
private static final String ETC_ALTERNATIVES_X_TERMINAL_EMULATOR

Constructor Detail

Linuxback to summary
public Linux()

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
getDefaultFileChooserDirectoryback to summary
public Path getDefaultFileChooserDirectory()

Overrides org.jabref.gui.desktop.os.NativeDesktop.getDefaultFileChooserDirectory.

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

Get the user's default file chooser directory

Annotations
@Override
nativeOpenFileback to summary
private void nativeOpenFile(String filePath)
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