Prevent Jabref from auto renaming and moving files

Hello, the previous version of jabref I used was 2.9.2. In that version, I could easily name my files, place them in a pdf folder, drag and drop it onto an entry in Jabref and it will happily link the file without being ‘too smart’.

In 5.2 however, jabref renames the file, moves it to .bib folder (which I absolutely do not want it to). How can I disable this functionality? All I want is for it to link a relative path and not do anything else.

Hi,
we switched to the modifier keys for drag and drop, see the help

Should be the path relative from the bib file or relative from a certain directory? If the latter is the case, one could change the main directory path in the JabRef Preferences: External Files.

If the path should be relative to the bib file, please set “.” as the “General file directory” at the “Library properties”

Then, please use the “Alt” key when dragging and dropping (at least on Windows)

Did you ever get this to work the way you needed?

I’m also having this issue and it looks like both the answers I see here miss the point of your question - that you DON’T want JabRef moving/copying and renaming your document files.

@astronomertom So you would like to have a switch to keep original file names?

Some kind of method to prevent it from moving/renaming files is vital. This is similar to the problem that made me drop BibDesk and Macs where the actual file location and the bibliography path to it was not reliable for importing into 3-d party software.

I’m at close to 12,000 entries in my JabRef Bib file, my area of work interlinking many topics so splitting them up is impractical. Many of these papers have very similar titles, or are parts of threads in discussion sections from physics magazines. With this technique, they all want to be in the same directory making it unusable.

Plus from a provenance perspective - ANY alteration of your source document can be a problem. A processing hiccup or bug adding metadata to a PDF could render it unusable and difficult to replace. Not everything is preserved on archive.org.

Thanks for your attention,
Tom

Some comment on this one:

Altering content of PDF files is always an action triggered by user explicitly. JabRef does not automatically do some “magic” change of the PDF contents.

The discussion here is only about file names. That users want to keep their filenames and not have JabRef generating “nice” filen ames.

3.8.2, the dialog renders as follows:

image

Offers two modes:

  1. Create new entry based on PDF
  2. Attach PDF

Drawback: Does not ask for renaming - and somehow confusing.

Currently, JabRef also allows to create a NEW entry based on the PDF by dropping between an entry in the main table:

Note that we had a preference for it: Link file (without copying) doesn't work · Issue #5546 · JabRef/jabref · GitHub

A long discussion was made at Dropping a PDF on an entry should be consistent · Issue #121 · JabRef/jabref · GitHub

The dialog was as follows


We want to have “Remember decision”, thus we will re-add a preference.

Notes on the dialog:

  • Outputting the file directory is nice, because it makes explicit, where the file will be placed
  • “Copy to file directory” is a nice setting if one copies from a shared network folder. However, “move” should be default and “Copy” is only a secondary choice
  • “Leave file in its current directory” is incomplete. It should be “Link the file”
  • File renaming activation and showing the new file name is nice

New Proposal

How would you like to treat the file ‘{file name}’ residing in {directory}?

  • Link file
  • Move file
  • Copy file

(radio group)


Target directory is: {file directory}

  • Rename file to {new file name}

(This part is only enabled if move or copy is selected)


Notes

  • are the defaults to the radio group
  • If file already resides inside a file directory, then “Link file” is the only enabled option AND “Rename file to” can be selected (because as user, I want to keep the file in the folder hierarchy of files). “a file directory” means that one JabRef’s file directories (global file directory, main file directory, user-specific file directory). – Let’s call this “Mode inside-bib-directory”
  • org.jabref.model.database.BibDatabaseContext#getFirstExistingFileDir returns the target directory.
  • org.jabref.model.entry.LinkedFile#findIn(java.util.List<java.nio.file.Path>) can be used to check if the file resides inside a directory (to switch the mode to “inside-bib-directory”)

This looks promising.
But are you saying this was an option of linking to the file (without moving or renaming) that is actually available, but not clearly specified?

Tom

I don’t know, what you mean by “specified”.

On Windows, you need to hold down the Alt key to link a file (without renaming). Similar to the Windows Explorer shortcuts.

I don’t know if this works on Linux or MacOS.