-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup Entries -> Rename PDFs Doesn't Preserve Key Case #466
Comments
Just checking (I have no idea how the code works, but I browsed it at least): what operating system do you run? Does JabRef show a dialog "File rename failed for XX entries?"? |
@oscargus Thanks for looking into this. I'm running two versions of OSX (10.9.5/Mavericks and 10.11/El Capitan) and both exhibit this problem. JabRef does not show a dialog. However, the status bar shows "Status: No entry needed a cleanup". However, if I rename the file from "article_2015_nt_woolley_191--207.pdf" to "arrticle_2015_nt_woolley_191--207.pdf" and then update the filename in JabRef, it will rename the file, with proper capitalization, to the key. Having not looking at it (I've never worked in Java), I'm guessing that it's doing a case-insensitive query on the filetype to see if it agrees with the key, if so, it finds "nothing to update". If there is a mismatch in the content, not the case, it will update both content and case. If this is true, hopefully making that case-insensitive query to be case-sensitive will not be a large change. |
I've checked the code further now and the main suspect is a call to File.exists(), which depending on the file system may or may not consider the case. Do you know if your file system is case sensitive or case insensitive? I think you partly can tell the answer of the above question based on if the problem is "only" cosmetic or if it actually prevents you from opening the file from JabRef. (With the reservation that opening files may use other methods which breaks my assumption.) |
As far as I know, OSX should be case sensitive (being Unix-based). When I navigate in the Terminal, it is most definitely case sensitive. To your point, this issue is "only" cosmetic in that JabRef can still open the file. However, I fear that this can cause issues when working between platforms (e.g., when I access the files using JabRef on Linux). Also, it is inconsistent with the purpose of the "clean up" command. As I indicated, I'm not a Java developer; however, I wonder if the |
OK! I've seen those commands in the threads as well, but it's not clear (to me at least) where they would be useful in the current implementation. It seems like there are some issues in this regard with OSX as the Java API is not always consistent with the file system, but I thought it was primarily the other way around. I agree with you though that ideally it should work the way that you want. Especially from the Linux aspect. A most likely feasible work-around is to do the cleanup on Linux, then it would probably work as expected. I can confirm that it works the same way on Windows anyway. The "problem" is somehow that currently the implementation (appears to) builds on the standard API with well defined calls, while solving this would require "hacks" as I understand it. But it is probably worth solving. |
Fix #466: Rename PDF cleanup now also changes case of file name
If the filename of a linked PDF is converted to lowercase outside of JabRef, when JabRef runs a Cleanup -> Rename PDFs, it does not rename/move the file back to "proper" upper/lower case consistent with its associated key.
For example, a file with key
Article_2015_NT_Woolley_191--207
will not be renamed toArticle_2015_NT_Woolley_191--207.pdf
fromarticle_2015_nt_woolley_191--207.pdf
.The text was updated successfully, but these errors were encountered: