laito / cleartk

Automatically exported from code.google.com/p/cleartk
0 stars 0 forks source link

LineReader creates a non-file URI #392

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
the URI created by LineReader needs to be revisited because trying to create a 
file out of it with:

new File(ViewUriUtil.getURI(jCas))

causes the following exception:

java.lang.IllegalArgumentException: URI has a fragment component

This is not cool especially if you are going to later use the URI to create a 
file name with later as you would do with the example XmiWriter.

Original issue reported on code.google.com by philip.o...@oracle.com on 30 Oct 2013 at 5:50

GoogleCodeExporter commented 9 years ago
The URI is a valid URI - a fragment is absolutely a valid component of a URI. 
It's just not a component supported by file systems.

Consider for example a reader that reads from a real URL, and not a file URI. A 
real URL can have both a query and a fragment, neither of which are 
representable in a file system URI.

So I think the problem is not really with LineReader, but that this is a 
feature request for XmiWriter to handle non-file URIs.

Original comment by steven.b...@gmail.com on 30 Oct 2013 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by phi...@ogren.info on 15 Mar 2014 at 6:05

GoogleCodeExporter commented 9 years ago
I'm going to do this one with issue #391.  I'm simply going to create a 
sub-class of XmiWriter that overrides the getXmiFile method to deal with the 
URIs generated from LineReader

Original comment by phi...@ogren.info on 30 Mar 2014 at 4:32

GoogleCodeExporter commented 9 years ago

Original comment by phi...@ogren.info on 30 Mar 2014 at 5:10