oxf:/ path in a custom java processor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

oxf:/ path in a custom java processor

Youssef Medaghri-Alaoui

Hi,

 

I’m using the 2.8 final and I needed to use the file-serializer to write a binary file from an xforms:upload.

 

The file-serializer don’t seem to serialize binary files so I wrote a serializer in java inside orbeon that I call from an oxf:java delegation processor .

 

Everything works fine but I still have a problem to get the absolute path name of a directory under /resources.

 

Here’s my question : Can you tell me how I can get the absolute path name of the /resources directory from my java processor :

 

à I’m in this function : public void generateData(PipelineContext pipelineContext, ContentHandler contentHandler) throws SAXException

 

Thanks,

 

Youssef Medaghri-Alaoui



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: oxf:/ path in a custom java processor

Erik Bruchez
Administrator
Youssef,

You can do this with the following code:

String realPath =
     ResourceManagerWrapper.instance().getRealPath(String resourceName);

You must pass an actual existing file as "resourceName". Note that an
actual ResourceManager implementation may or may not support returning a
real path.

-Erik

Youssef Medaghri-Alaoui wrote:

> Hi,
>
>  
>
> I’m using the 2.8 final and I needed to use the file-serializer to write
> a binary file from an xforms:upload.
>
>  
>
> The file-serializer don’t seem to serialize binary files so I wrote a
> serializer in java inside orbeon that I call from an oxf:java delegation
> processor .
>
>  
>
> Everything works fine but I still have a problem to get the absolute
> path name of a directory under /resources.
>
>  
>
> _Here’s my question_ : Can you tell me how I can get the absolute path
> name of the /resources directory from my java processor :
>
>  
>
> à I’m in this function : public void generateData(PipelineContext
> pipelineContext, ContentHandler contentHandler) throws SAXException
>
>  
>
> Thanks,
>
>  
>
> Youssef Medaghri-Alaoui


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws