Hi there!

It's the first time I use vfs so maybe it's just a common mistake but I've not 
been able to make it work appropriately.
I need to fetch a webdav file so my code it's something like this:

<pre>
URI inputFileUri = normalizarURI(inputFile);
FileSystemManager fsManager = VFS.getManager();
FileObject sourceFile = fsManager.resolveFile(inputFileUri.toString());
return sourceFile.getContent().getInputStream();
</pre>

To the point of the third line inputFileUri's value is something like
<pre>
webdav://ipa001:****@alf.zylk.net:8080/alfresco/webdav/webdav/Zylk/Guest/irune/sinadura%20webdav%20
 [^]
test%20%c3%a1%c3%a9i%c3%b3%c3%ba%c3%b1_%c3%b1/pdf%20con%20espacios.pdf
</pre>

which stands for
<pre>
/irune/sinadura webdav test áéióúñ_ñ/pdf con espacios.pdf
</pre>

The problem is that I get the following exception
<pre>
Exception in thread "main" org.apache.commons.vfs2.FileSystemException: GET 
method failed 
for 
"webdav://alf.zylk.net:8080/alfresco/webdav/webdav/Zylk/Guest/irune/sinadura 
webdav test Ã
¡Ã©ióúñ_ñ/pdf con espacios.pdf".
</pre>

This is due to the url being decoded with ISO-8859-1 instead of UTF-8.

I lack the proper knowledge to understand low level programing but I've reached 
the point in which this URI is decoded in the file
'org.apache.commons.vfs2.provider.URIParser' method 'canonicalizePath' and it 
seems as if the canonicalization doesn't do it in the utf-8 way (variable 
lenght).

__

I've fixed my problem with a normalization of the inputFileURI, making a utf-8 
url decode and then an iso-8859-1 url encode and this way vfs fetch the file 
correctly.

I think there may be another way of doing it but I've not been able to find 
it.... any tips?

Thx in advance,

Irune Prado :: zylk.net (944272119)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to