Strange behavior when source for a res:/... file content

Poster Content
nk4um User
Posts: 37
January 28, 2015 13:00

Posted by tab (View)
Hi Radu, make sure you source the resource as a binary stream. It looks like you are seeing the result of a .toString() on the returned representation which does indeed return the fully qualified path.

Cheers, Tony

Actually was pretty simple ... I passed the argument with addArgumentByValue instead of addArgument ... So it sources the pbv:... and returned the filename ... What confused me (and made not be able to solve it instantly) was that it changed the res:/... to the actual filename.

Thanks anyway for your quick answer,

Radu

Like · Post Reply
nk4um Administrator
Posts: 607
January 28, 2015 12:55

Hi Radu, make sure you source the resource as a binary stream. It looks like you are seeing the result of a .toString() on the returned representation which does indeed return the fully qualified path.

Cheers, Tony

Like · Post Reply
nk4um User
Posts: 37
January 28, 2015 12:01Strange behavior when source for a res:/... file content

Hi!

I have a space and inside it a mapper that expose some file system content.

<mapper>
  <config>
    <endpoint>
      <grammar>res:/fsm-common/
        <groupname="fsmCommonResource">
          <regextype="anything" /&gt;
        &lt;/group&gt;
      &lt;/grammar&gt;
      <request>
        <identifier>res:/resources/[[arg:fsmCommonResource]]&lt;/identifier&gt;
      &lt;/request&gt;
    &lt;/endpoint&gt;
  &lt;/config&gt;
  <space>
    <fileset>
      <glob>resources/*&lt;/glob&gt;
    &lt;/fileset&gt;
  &lt;/space&gt;
&lt;/mapper&gt;

In the folder resources I have a folder scripts and inside it a folder su (from superuser). I have also in scripts a folder global with two files in it.

The problem appears when I try to retrieve the content of the

res:/fsm-commmon/scripts/su/show.txt
file content.

The response of

SOURCE res:/fsm-commmon/scripts/su/show.txt
is the full path toward the file in the module instead of being the content of the file.

For the files in /scripts/global I receive the content of the files as expected (in a slightly different context).

I have no clue how to deal with this issue ...

Any ideas/hints/tips will be very appreciated.

Thanks!

Like · Post Reply