The file in cache is read through a FileSourceFactory in v3 and path is decoded once calling new FileSource(path)
The file in cache is read through the AmetysHomeSourceFactory and path is not decoded calling new FileSource("file", new File(ametysHomeDir, childLocation)
Maybe we have to do :
returnnew FileSource("file", new File(ametysHomeDir, SourceUtil.decodePath(childLocation)));
Laurence Aumeunier
added a comment - - edited The difference between v3 and v4 :
The file in cache is read through a FileSourceFactory in v3 and path is decoded once calling new FileSource(path)
The file in cache is read through the AmetysHomeSourceFactory and path is not decoded calling new FileSource("file", new File(ametysHomeDir, childLocation)
Maybe we have to do :
return new FileSource( "file" , new File(ametysHomeDir, SourceUtil.decodePath(childLocation)));
The images are correctly served and stored in site cache.
But the file URI contains "ametys-internal%253AAsites" whereas the folders created on hard drive are "ametys-internal%3Acontents"
Laurence Aumeunier
added a comment - The images are correctly served and stored in site cache.
But the file URI contains "ametys-internal%253AAsites" whereas the folders created on hard drive are "ametys-internal%3Acontents"
Requested file URI:
Resource not found for URI : file:/D:/Dev/Ametys/templates/CMSWEB/trunk/webapp/site/WEB-INF/data/cache/www/_contents-images/ametys-internal%253Asites/www/ametys-internal%253Acontents/galerie-multimedia-galerie-de-photos-2/_metadata/photos/1/image_150x150/43.jpg
vs real file URI
D:\Dev\Ametys\templates\CMSWEB\trunk\webapp\site\WEB-INF\data\cache\www_contents-images\ametys-internal%3Asites\www\ametys-internal%3Acontents\galerie-multimedia-galerie-de-photos-2_metadata\photos\1\image_150x150\43.jpg
Note that the preview and live pages of the cms use the same url and are working fine.
Grégory Lefebvre (Inactive)
added a comment - - edited There is an encoding problem when resolving the images urls.
In v3.x, images worked with (%253A) : http://demo.ametys.org/_contents-images/ametys-internal%253Asites/www/ametys-internal%253Acontents/ ...
In v4.0M8, in the site :
with the same url, we have an error 404
but this url is working (%3A) : http://***/_contents-images/ametys-internal%3Asites/www/ametys-internal%3Acontents/ ...
Note that the preview and live pages of the cms use the same url and are working fine.
The difference between v3 and v4 :
Maybe we have to do :