John,

I apologize. Our test cases for cas.setSofaDataURI() all used an
explicitly created view. As you have shown, there a bug when the
_InitialView is used.

A workaround for now is use a named view,

CAS testView = cas.createView("remoteView");
remoteView .setSofaDataURI(inputFileURI,
mimetypeMap.getContentType(inputFileURI));

Thanks for finding this,
Eddie

On Feb 19, 2008 6:10 PM, John Cabral <[EMAIL PROTECTED]> wrote:
> You mean from the mimetypeMap  object?  That's returning "plain/text."
>   I tried it with that value hard-coded in (and no usage of the
> mimetypes map ) and it behaved exactly the same way.  Here try this
> code:
>
> MimetypesFileTypeMap map = new MimetypesFileTypeMap ();
> System.out.println(map.getContentType("someRandomName.txt");
>
>
> If not that kind of map, sorry for the misinterpretation, what other
> map might you be referring to?
>
>
> Thank you.
>
> John C.
>
>
> On Feb 19, 2008 5:28 PM, Eddie Epstein <[EMAIL PROTECTED]> wrote:
> > On Feb 19, 2008 5:22 PM, John Cabral <[EMAIL PROTECTED]> wrote:
> > > I am trying to pass the URI of the file I want to process to my
> > > engine.   The code that I am using works as expected when I extract
> > > the text from a text document and add it to a CAS using its
> > > setDocumentText() method.  What is the proper set of methods that need
> > > to be called when sending just the URI?  This is the basic code that I
> > > am using:
> > >
> > > AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier);
> > > CAS cas = ae.newCAS();
> > > MimetypesFileTypeMap mimetypeMap = new MimetypesFileTypeMap ();
> > > cas.setSofaDataURI(inputFileURI,  
> > > mimetypeMap.getContentType(inputFileURI));
> > >
> > > At the last line I get this error (this is the complete trace):
> > >
> > > java.lang.ArrayIndexOutOfBoundsException: -1
> > >
> >
> > The method cas.setSofaDataURI(String, String) is not throwing the
> > exception here. Looks to me like access to an empty map is doing it.
> >
> > Eddie
> >
>

Reply via email to