﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17238	[Patch] Poor error handling when saving to non-existing directory	GerdP	GerdP	"==== What steps will reproduce the problem?
1. Open new data layer
2. Create a closed way
3. Click Save As 
4. In the select box ""Files of type"" chose ""Osmosis polygon filter files (*.poly)""
5. Enter a file name with a directory that doesn't exist, e.g. c:\xyz\test

==== What is the expected result?
A popup that says something like ""target directory doesn't exist"" 

==== What happens instead?
Nothing obvious happens in the dialog. Only the console shows an error message and a trace:
{{{
2019-01-24 10:35:22.654 SEVERE: java.io.FileNotFoundException: c:\xyz\test.poly (Das System kann den angegebenen Pfad nicht finden)
java.io.FileNotFoundException: c:\xyz\test.poly (Das System kann den angegebenen Pfad nicht finden)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at poly.PolyExporter.exportData(PolyExporter.java:40)
	at org.openstreetmap.josm.actions.SaveActionBase.doInternalSave(SaveActionBase.java:101)
	at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:73)
	at org.openstreetmap.josm.actions.SaveActionBase.doSave(SaveActionBase.java:60)
	at org.openstreetmap.josm.actions.SaveActionBase.actionPerformed(SaveActionBase.java:50)
	at javax.swing.SwingUtilities.notifyAction(Unknown Source)
	at javax.swing.JComponent.processKeyBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireBinding(Unknown Source)
	at javax.swing.KeyboardManager.fireKeyboardAction(Unknown Source)
	at javax.swing.JComponent.processKeyBindingsForAllComponents(Unknown Source)
	at javax.swing.JComponent.processKeyBindings(Unknown Source)
	at javax.swing.JComponent.processKeyEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
	at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
}}}

==== Please provide any additional information below. Attach a screenshot if possible.

Not sure if IO problems like this should be handled in each plugin? I think no. The attached patch catches shows a popup if the plugin throws an IOE.

{{{
Build-Date:2019-01-24 10:34:37
Revision:14726
Is-Local-Build:true

Identification: JOSM/1.5 (14726 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 1803 (17134)
Memory Usage: 578 MB / 1753 MB (179 MB allocated, but free)
Java version: 1.8.0_191-b12, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Screen: \Display0 1920x1080
Maximum Screen Size: 1920x1080
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:57456, -ea, -Dfile.encoding=UTF-8]
Program arguments: [--debug]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (34535)
+ apache-commons (34506)
+ buildings_tools (34850)
+ download_along (34838)
+ ejml (34389)
+ geotools (34513)
+ jaxb (34506)
+ jts (34524)
+ o5m (34846)
+ opendata (34805)
+ pbf (34858)
+ poly (34546)
+ reltoolbox (34788)
+ reverter (34552)
+ utilsplugin2 (34844)

Tagging presets:
+ https://raw.githubusercontent.com/OpenNauticalChart/josm/master/INT-1-preset.xml
+ https://josm.openstreetmap.de/josmfile?page=Presets/Historical_Objects&zip=1

Last errors/warnings:
- W: No configuration settings found.  Using hardcoded default values for all pools.
- E: java.io.FileNotFoundException: c:\xyz\test.poly (Das System kann den angegebenen Pfad nicht finden)
}}}
"	defect	closed	normal	19.04	Core		fixed	template_report	
