Maybe it's time to introduce OnlineLinkedFile, PathLinkedFile and InvalidLinkedFile deriving from an abstract LinkedFile class (as we currently parse a string to a LinkedFile trying to convert strings to paths and urls, but then LinkedFile converts them to a string again...). Something for another time.
Some OO thingy:
Soure: https://github.com/JabRef/jabref/pull/7347#event-4243067873