You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stanbol.apache.org by Suman Saurabh <ss...@gmail.com> on 2014/06/21 08:57:03 UTC

Does DataFileProvider Service provides URL location

Hi Rupert, All,

I was playing with the implementation of DataFileprovider service provided
by OpenNLP. It provides the InputStream of the data to the bundle (that's
what DataFileProvider  service do). I want to get the location (URL) of the
model file from where it is parsed i.e.
eg. 'stanbol/datafile/path/to/file' or
'jar:file:/home/.m2/repository/jarfile.jar!/path/to/file'

Sphinx needs the URL to load the model files. No such api has been provided
yet by Sphnix to load the model as Stream ( I confirmed it from the
discussion forum ).

Is there a way to get the URL,
DataFileproviderEvent.getActualFileLocation() returns information of
location of file, if I am correct can this service be used or I have to
develop an api to provide the service of accessing URL of file?

Regards,
Suman Saurabh

Re: Does DataFileProvider Service provides URL location

Posted by Suman Saurabh <ss...@gmail.com>.
Hi Rupert,

I have created the issue [1], in the mean time I will use commons-io
FileUtils helper to build SpeechToText engine.

Regards,
Suman Saurabh

[1] https://issues.apache.org/jira/browse/STANBOL-1355


On Sat, Jun 21, 2014 at 5:17 PM, Rupert Westenthaler <
rupert.westenthaler@gmail.com> wrote:

> Hi Suman,
>
> Currently it is not possible to acquire the File location of the
> Datafiles. However this is something we might want to add to the
> DatafileProvider interface. Can you create an Issue about that.
>
> In the meantime you can use the input stream and create a temp file as
> a workaround
>
> Best to use the commons-io FileUtils helper for that.
>
>     org.apache.commons.io.FileUtils.copyInputStreamToFile(
>         File.createTempFile(prefix, suffix), destination);
>
>
> best
> Rupert
>
>
> On Sat, Jun 21, 2014 at 8:57 AM, Suman Saurabh
> <ss...@gmail.com> wrote:
> > Hi Rupert, All,
> >
> > I was playing with the implementation of DataFileprovider service
> provided
> > by OpenNLP. It provides the InputStream of the data to the bundle (that's
> > what DataFileProvider  service do). I want to get the location (URL) of
> the
> > model file from where it is parsed i.e.
> > eg. 'stanbol/datafile/path/to/file' or
> > 'jar:file:/home/.m2/repository/jarfile.jar!/path/to/file'
> >
> > Sphinx needs the URL to load the model files. No such api has been
> provided
> > yet by Sphnix to load the model as Stream ( I confirmed it from the
> > discussion forum ).
> >
> > Is there a way to get the URL,
> > DataFileproviderEvent.getActualFileLocation() returns information of
> > location of file, if I am correct can this service be used or I have to
> > develop an api to provide the service of accessing URL of file?
> >
> > Regards,
> > Suman Saurabh
>
>
>
> --
> | Rupert Westenthaler             rupert.westenthaler@gmail.com
> | Bodenlehenstraße 11                              ++43-699-11108907
> | A-5500 Bischofshofen
> | REDLINK.CO
> ..........................................................................
> | http://redlink.co/
>

Re: Does DataFileProvider Service provides URL location

Posted by Rupert Westenthaler <ru...@gmail.com>.
Hi Suman,

Currently it is not possible to acquire the File location of the
Datafiles. However this is something we might want to add to the
DatafileProvider interface. Can you create an Issue about that.

In the meantime you can use the input stream and create a temp file as
a workaround

Best to use the commons-io FileUtils helper for that.

    org.apache.commons.io.FileUtils.copyInputStreamToFile(
        File.createTempFile(prefix, suffix), destination);


best
Rupert


On Sat, Jun 21, 2014 at 8:57 AM, Suman Saurabh
<ss...@gmail.com> wrote:
> Hi Rupert, All,
>
> I was playing with the implementation of DataFileprovider service provided
> by OpenNLP. It provides the InputStream of the data to the bundle (that's
> what DataFileProvider  service do). I want to get the location (URL) of the
> model file from where it is parsed i.e.
> eg. 'stanbol/datafile/path/to/file' or
> 'jar:file:/home/.m2/repository/jarfile.jar!/path/to/file'
>
> Sphinx needs the URL to load the model files. No such api has been provided
> yet by Sphnix to load the model as Stream ( I confirmed it from the
> discussion forum ).
>
> Is there a way to get the URL,
> DataFileproviderEvent.getActualFileLocation() returns information of
> location of file, if I am correct can this service be used or I have to
> develop an api to provide the service of accessing URL of file?
>
> Regards,
> Suman Saurabh



-- 
| Rupert Westenthaler             rupert.westenthaler@gmail.com
| Bodenlehenstraße 11                              ++43-699-11108907
| A-5500 Bischofshofen
| REDLINK.CO ..........................................................................
| http://redlink.co/