Skip to content
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 > rename pdfs sometimes creates too long file names for windows #2622

Closed
eeenilsson opened this issue Mar 6, 2017 · 6 comments
Closed
Labels
bug Confirmed bugs or reports that are very likely to be bugs

Comments

@eeenilsson
Copy link

JabRef version 3.8.2 on Windows 7

Steps to reproduce:

  1. On windows, import a reference + PDF with a really long name.
  2. Cleanup entry > check rename PDF

I filename is long enough this creates a PDF (path to file > 260 characters) that cannot be handled appropriately by the Windows OS.

Perhaps truncate or give a warning when new filename is > 100 characters long?

@Siedlerchr
Copy link
Member

Could you please test the current dev version? It should trow an error if the renaming can not be done.
https://builds.jabref.org/master/

@lenhard lenhard added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Mar 6, 2017
@stefan-kolb stefan-kolb added bug Confirmed bugs or reports that are very likely to be bugs and removed status: waiting-for-feedback The submitter or other users need to provide more information about the issue labels Mar 8, 2017
@stefan-kolb
Copy link
Member

16:21:34.960 [AWT-EventQueue-0] ERROR org.jabref.logic.cleanup.RenamePdfCleanup - Could not create necessary target directoires for renaming
java.nio.file.FileSystemException: C:\Users\stfn\Downloads\01 - TEMP\22222 - niodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebovniodbnveovboebov.pdf: Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.

	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) ~[?:1.8.0_121]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) ~[?:1.8.0_121]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) ~[?:1.8.0_121]
	at sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:504) ~[?:1.8.0_121]
	at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_121]
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_121]
	at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_121]
	at org.jabref.logic.cleanup.RenamePdfCleanup.cleanup(RenamePdfCleanup.java:115) [main/:?]
	at org.jabref.gui.externalfiles.RenameFileAction.actionPerformed(RenameFileAction.java:87) [main/:?]
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) [?:1.8.0_121]
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) [?:1.8.0_121]
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) [?:1.8.0_121]
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) [?:1.8.0_121]
	at javax.swing.AbstractButton.doClick(AbstractButton.java:376) [?:1.8.0_121]
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833) [?:1.8.0_121]
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877) [?:1.8.0_121]
	at java.awt.Component.processMouseEvent(Component.java:6533) [?:1.8.0_121]
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) [?:1.8.0_121]
	at java.awt.Component.processEvent(Component.java:6298) [?:1.8.0_121]
	at java.awt.Container.processEvent(Container.java:2236) [?:1.8.0_121]
	at java.awt.Component.dispatchEventImpl(Component.java:4889) [?:1.8.0_121]
	at java.awt.Container.dispatchEventImpl(Container.java:2294) [?:1.8.0_121]
	at java.awt.Component.dispatchEvent(Component.java:4711) [?:1.8.0_121]
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) [?:1.8.0_121]
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) [?:1.8.0_121]
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) [?:1.8.0_121]
	at java.awt.Container.dispatchEventImpl(Container.java:2280) [?:1.8.0_121]
	at java.awt.Window.dispatchEventImpl(Window.java:2746) [?:1.8.0_121]
	at java.awt.Component.dispatchEvent(Component.java:4711) [?:1.8.0_121]
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) [?:1.8.0_121]
	at java.awt.EventQueue.access$500(EventQueue.java:97) [?:1.8.0_121]
	at java.awt.EventQueue$3.run(EventQueue.java:709) [?:1.8.0_121]
	at java.awt.EventQueue$3.run(EventQueue.java:703) [?:1.8.0_121]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_121]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) [?:1.8.0_121]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) [?:1.8.0_121]
	at java.awt.EventQueue$4.run(EventQueue.java:731) [?:1.8.0_121]
	at java.awt.EventQueue$4.run(EventQueue.java:729) [?:1.8.0_121]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_121]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) [?:1.8.0_121]
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) [?:1.8.0_121]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) [?:1.8.0_121]
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) [?:1.8.0_121]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) [?:1.8.0_121]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:1.8.0_121]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) [?:1.8.0_121]
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) [?:1.8.0_121]

Also, if the file to be renamed does not exist no message is given to the user.

@stefan-kolb
Copy link
Member

@Siedlerchr We could auto truncate filenames to keep the limit but this would potentially break the auto link files algorithm. Otherwise we could forward the error in the UI but this would also not really help the user except that he sees that the renaming is not working. Not sure which way to go.

@cayleylz
Copy link

cayleylz commented May 7, 2017

If you are having problem to move/delete files with long names try using Long Path Tool.

@koppor
Copy link
Member

koppor commented May 8, 2017

Windows 10 supports long paths, if you tweak the registry (see https://superuser.com/a/1122610/138868)

HKLM\SYSTEM\CurrentControlSet\Control\FileSystem -> Set LongPathsEnabled as DWORD to 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs
Projects
None yet
Development

No branches or pull requests

7 participants
@Siedlerchr @koppor @lenhard @stefan-kolb @eeenilsson @cayleylz and others