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

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

Closed
lenhard opened this issue Dec 11, 2015 · 7 comments
Closed

Comments

@lenhard
Copy link
Member

lenhard commented Dec 11, 2015

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.

@koppor
Copy link
Member

koppor commented Dec 15, 2015

I really like to entry the path manually. I typically copy and paste from the Windows explorer.

Similar issue for the directory per bibtex entry. There, I typically key in . to indicate that JabRef should search beginning from the directory of the bib file.

grabbed_20151215-180958

@lenhard
Copy link
Member Author

lenhard commented Dec 15, 2015

Well, I also like to enter the path manually, so let's keep that.

So that means we should display a proper error message in the UI!

@matthiasgeiger
Copy link
Member

Error message when saving the preferences?
Or: error message when storing of a downloaded file fails?
(Or in both cases to handle the issue that a formerly existing directory is deleted?)

@simonharrer
Copy link

👍 for both cases.

@koppor
Copy link
Member

koppor commented Sep 11, 2016

Related: JabRef#1949

@boceckts
Copy link

PR was merged and related issue is closed so I think this can be closed, too.

@lenhard
Copy link
Member Author

lenhard commented Oct 10, 2016

@boceckts You are correct. To be on the safe side, I just tested it on master and the error message appears as desired.

@lenhard lenhard closed this as completed Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants