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

public Class Linux

extends NativeDesktop
Class Inheritance
Annotations
@AllowedToUseAwt:Requires AWT to open a file with the native method
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.Launcher, org.jabref.architecture.AllowedToUseAwt, org.jabref.gui.DialogService, org.jabref.gui.externalfiletype.ExternalFileType, .ExternalFileTypes, org.jabref.gui.util.StreamGobbler, org.jabref.logic.l10n.Localization, org.jabref.logic.util.HeadlessExecutorService, org.jabref.preferences.FilePreferences, 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 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

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 String
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, 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:
getBackupDirectorygetFulltextIndexBaseDirectorygetHostNamegetLogDirectorygetSslDirectorygetUserDirectorymoveToTrashmoveToTrashSupported

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

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
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

Returns:Path

the path

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, 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