Skip to content

File storage fails silently when setting a non-exitent file directory #109

@lenhard

Description

@lenhard

When I set the "Main file directory" (Preferences->External Programs->Main file directory) to a directory that does not exist, then file download fails silently.

I can trigger the dowload, choose to save the file and everything looks fine in the UI, but no entry appears in the file field. Looking at the console, the following stack trace appears:

java.io.FileNotFoundException: asd\hajjat10benefit.pdf (Das System kann den angegebenen Pfad nicht finden)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:156)
    at net.sf.jabref.logic.util.io.FileUtil.copyFile(FileUtil.java:122)
    at net.sf.jabref.external.DownloadExternalFile.download(DownloadExternalFile.java:220)
    at net.sf.jabref.external.FindFullTextAction.update(FindFullTextAction.java:72)
    at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at spin.Invocation.evaluate(Invocation.java:175)
    at spin.over.SpinOverEvaluator.evaluate(SpinOverEvaluator.java:62)
    at spin.ProxyFactory.evaluteInvocation(ProxyFactory.java:85)
    at spin.JDKProxyFactory$SpinInvocationHandler.invoke(JDKProxyFactory.java:102)
    at com.sun.proxy.$Proxy0.update(Unknown Source)
    at net.sf.jabref.gui.BasePanel.runCommand(BasePanel.java:1232)
    at net.sf.jabref.gui.fieldeditors.FileListEditor$14.actionPerformed(FileListEditor.java:441)
    at net.sf.jabref.util.Util$1$1.run(Util.java:913)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
    at java.awt.EventQueue.access$400(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.awt.EventQueue$3.run(EventQueue.java:691)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
    at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:184)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:229)
    at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:227)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:227)
    at java.awt.Dialog.show(Dialog.java:1084)
    at java.awt.Component.show(Component.java:1656)
    at java.awt.Component.setVisible(Component.java:1608)
    at java.awt.Window.setVisible(Window.java:1014)
    at java.awt.Dialog.setVisible(Dialog.java:1005)
    at net.sf.jabref.util.Util$2.run(Util.java:925)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
    at java.awt.EventQueue.access$400(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:697)
    at java.awt.EventQueue$3.run(EventQueue.java:691)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Perhaps we should change the preference setting in the UI. Currently, it is a text field and the user can enter arbitrary text instead of using the FileChooser. If we set it to a Label instead, the user has to select the directory via the FileChooser. Additionally, there should be some error message to the user if the storage of the file fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions