Top Fields Constructors Methods
org.jabref.logic.importer.util

public Class FileFieldParser

extends Object
Class Inheritance
Imports
java.net.MalformedURLException, .URL, java.nio.file.InvalidPathException, .Path, java.util.ArrayList, .List, org.jabref.model.entry.LinkedFile, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private StringBuilder
private static final Logger
private final String
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static LinkedFile

Returns:

a LinkedFile object
convert
(List<String>
the list of elements in the linked file textual representation
entry
)

Converts the given textual representation of a LinkedFile object SIDE EFFECT: The given entry list is cleared upon completion Expected format is: description:link:fileType:sourceURL fileType is an org.jabref.gui.externalfiletype.ExternalFileType, which contains a name and a mime type

public static List<LinkedFile>
parse(String value)

Converts the string representation of LinkedFileData to a List of LinkedFile The syntax of one element is description:path:type Multiple elements are concatenated with ; The main challenges of the implementation are:

  • that XML characters might be included (thus one cannot simply split on ";")
  • some characters might be escaped
  • Windows absolute paths might be included without escaping
public List<LinkedFile>
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charactersOfCurrentElementback to summary
private StringBuilder charactersOfCurrentElement
LOGGERback to summary
private static final Logger LOGGER
valueback to summary
private final String value
windowsPathback to summary
private boolean windowsPath

Constructor Detail

FileFieldParserback to summary
public FileFieldParser(String value)

Method Detail

convertback to summary
pack-priv static LinkedFile convert(List<String> entry)

Converts the given textual representation of a LinkedFile object SIDE EFFECT: The given entry list is cleared upon completion Expected format is: description:link:fileType:sourceURL fileType is an org.jabref.gui.externalfiletype.ExternalFileType, which contains a name and a mime type

Parameters
entry:List<String>

the list of elements in the linked file textual representation

Returns:LinkedFile

a LinkedFile object

parseback to summary
public static List<LinkedFile> parse(String value)

Converts the string representation of LinkedFileData to a List of LinkedFile The syntax of one element is description:path:type Multiple elements are concatenated with ; The main challenges of the implementation are:

  • that XML characters might be included (thus one cannot simply split on ";")
  • some characters might be escaped
  • Windows absolute paths might be included without escaping
parseback to summary
public List<LinkedFile> parse()
resetDataStructuresForNextElementback to summary
private void resetDataStructuresForNextElement()