Top Fields Constructors Methods
org.jabref.gui.externalfiletype

public Class ExternalFileTypes

extends Object
Class Inheritance
Imports
java.nio.file.Path, java.util.ArrayList, .Arrays, .Collection, .HashSet, .List, .Locale, .Optional, .Set, org.jabref.logic.bibtex.FileFieldWriter, org.jabref.logic.util.io.FileUtil, org.jabref.model.entry.LinkedFile, org.jabref.model.strings.StringUtil, org.jabref.preferences.FilePreferences

Field Summary

Modifier and TypeField and Description
private static final String
private static final ExternalFileType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Set<ExternalFileType>
fromString(String storedFileTypes)

Set up the list of external file types, either from default values, or from values recorded in PreferencesService.

public static List<ExternalFileType>
public static Optional<ExternalFileType>

Returns:

The ExternalFileType registered, or null if none.
getExternalFileTypeByExt
(String
The file extension.
extension
,
FilePreferences filePreferences)

Look up the external file type registered for this extension, if any.

public static Optional<ExternalFileType>
public static Optional<ExternalFileType>
getExternalFileTypeByLinkedFile(LinkedFile linkedFile, boolean deduceUnknownType, FilePreferences filePreferences)

public static Optional<ExternalFileType>

Returns:

The ExternalFileType registered, or null if none. For the mime type "text/html", a valid file type is guaranteed to be returned.
getExternalFileTypeByMimeType
(String
The MIME type.
mimeType
,
FilePreferences filePreferences)

Look up the external file type registered for this MIME type, if any.

public static Optional<ExternalFileType>

Returns:

The ExternalFileType registered, or null if none.
getExternalFileTypeByName
(String
The file type name.
name
,
FilePreferences filePreferences)

Look up the external file type registered with this name, if any.

public static Optional<ExternalFileType>

Returns:

The ExternalFileType registered, or null if none.
getExternalFileTypeForName
(String
The name of the file whose type to look up.
filename
,
FilePreferences filePreferences)

Look up the external file type registered for this filename, if any.

public static boolean

Returns:

true if an ExternalFileType with the extension exists, false otherwise
isExternalFileTypeByExt
(String
The file extension.
extension
,
FilePreferences filePreferences)

Returns true if there is an external file type registered for this extension.

public static String

Returns:

A StringList of customized and removed file types compared to the default list of external file types for storing
toStringList
(Collection<ExternalFileType> fileTypes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FILE_TYPE_REMOVED_FLAGback to summary
private static final String FILE_TYPE_REMOVED_FLAG
HTML_FALLBACK_TYPEback to summary
private static final ExternalFileType HTML_FALLBACK_TYPE

Constructor Detail

ExternalFileTypesback to summary
private ExternalFileTypes()

Method Detail

fromStringback to summary
public static Set<ExternalFileType> fromString(String storedFileTypes)

Set up the list of external file types, either from default values, or from values recorded in PreferencesService.

getDefaultExternalFileTypesback to summary
public static List<ExternalFileType> getDefaultExternalFileTypes()
getExternalFileTypeByExtback to summary
public static Optional<ExternalFileType> getExternalFileTypeByExt(String extension, FilePreferences filePreferences)

Look up the external file type registered for this extension, if any.

Parameters
extension:String

The file extension.

Returns:Optional<ExternalFileType>

The ExternalFileType registered, or null if none.

getExternalFileTypeByFileback to summary
public static Optional<ExternalFileType> getExternalFileTypeByFile(Path file, FilePreferences filePreferences)
getExternalFileTypeByLinkedFileback to summary
public static Optional<ExternalFileType> getExternalFileTypeByLinkedFile(LinkedFile linkedFile, boolean deduceUnknownType, FilePreferences filePreferences)
getExternalFileTypeByMimeTypeback to summary
public static Optional<ExternalFileType> getExternalFileTypeByMimeType(String mimeType, FilePreferences filePreferences)

Look up the external file type registered for this MIME type, if any.

Parameters
mimeType:String

The MIME type.

Returns:Optional<ExternalFileType>

The ExternalFileType registered, or null if none. For the mime type "text/html", a valid file type is guaranteed to be returned.

getExternalFileTypeByNameback to summary
public static Optional<ExternalFileType> getExternalFileTypeByName(String name, FilePreferences filePreferences)

Look up the external file type registered with this name, if any.

Parameters
name:String

The file type name.

Returns:Optional<ExternalFileType>

The ExternalFileType registered, or null if none.

getExternalFileTypeForNameback to summary
public static Optional<ExternalFileType> getExternalFileTypeForName(String filename, FilePreferences filePreferences)

Look up the external file type registered for this filename, if any.

Parameters
filename:String

The name of the file whose type to look up.

Returns:Optional<ExternalFileType>

The ExternalFileType registered, or null if none.

isExternalFileTypeByExtback to summary
public static boolean isExternalFileTypeByExt(String extension, FilePreferences filePreferences)

Returns true if there is an external file type registered for this extension.

Parameters
extension:String

The file extension.

Returns:boolean

true if an ExternalFileType with the extension exists, false otherwise

toStringListback to summary
public static String toStringList(Collection<ExternalFileType> fileTypes)
Returns:String

A StringList of customized and removed file types compared to the default list of external file types for storing