Closed drj11 closed 4 years ago
Which file browser and Java version are you trying this with? I just tried with nautilus and JDK9 and I can't seem to drop into that field.
If that is an accurate copy and paste of the stack trace and GitHub hasn't changed anything then the index 56 is a normal space character U+0020 that has been added after the end of the file name.
The drag and drop into the parameter field doesn't work for me on Mac but I know my machine does the same thing when I drag a file from Finder into the Terminal, it inserts the file path followed by a trailing space (which make perfect sense there as you're typically going to want to use the file name as an argument to something and don't want to accidentally glue two arguments together).
Yes, I'd just come to the same conclusion. I suppose I could have the ResourceReference
constructor trim the value before turning it into a URI as a space on the end is highly unlikely to ever be right (I would assume).
Although weirdly, I've just tried adding a space to the end of a filename and that doesn't throw an exception (was filling in sourceUrl for a document but the code should be the same)
When I manually add a space at the end of a file:///something URL I do get the illegal argument exception.
In my case, just drag+drop to the input field does not work, but first clicking the input field and then doing the drag and drop does work. (Ubuntu, xfce window manager).
BTW, doing the same with the URL-typed entry field, e.g. for a document sourceUrl, the trailing space seems to get ignored.
Ah, I missed that sourceUrl is still a URL (that's probably an issue itself). Sounds like I'm not doing a trim()
somewhere in the resource reference stuff that I am with the URLs
I got an unhandled exception pop-up when filling the
pythonProgram
initialisation parameter of the Python plugin (gateplugin-python
). I'm creating an issue ingate-core
because I assume that it's an issue with anyResourceReference
type parameter.It happens after I drag a file icon from my file browser into the parameter value field. And the press OK. Slightly to my surprise, dragging the icon into the value field appears to work (it may be the case that you have to select the value field to make it active) and looks like it's the same as pasting the full
file://
URI for the file into the field. But when I press [OK] I get the popup.Output in message window:
I am investigating the characters more closely. Obviously a bit tricky as at least one of them is invisibly suspicious. The file itself has a perfectly ordinary name by the way.