If there, I've done a simple test on my machine and it works. See the attached file.
Could you send a reproducible test case? Best regards, Jerome Louvel -- Restlet ~ Founder and Technical Lead ~ http://www.restlet.org Noelios Technologies ~ http://www.noelios.com -----Message d'origine----- De : [email protected] [mailto:[email protected]] Envoyé : mercredi 20 janvier 2010 01:36 À : [email protected] Objet : DirectoryServerResource doesn't correctly handle file names with more than one "." Not sure if this is a bug or I'm doing something incorrectly. Here's the scenario: * SpringBeanRouter with a Directory attached to it (/resource linked to /home/user/resourceDirectory on filesystem) * File named foo.bar.js located at /home/user/resourceDirectory/foo.bar.js * Performing a GET on /resource/foo.bar.js results in a 404 After digging through code, I made the following change to DirectoryServerResource.java that seems to have fixed the bug for me. Proposed patch... Index: modules/org.restlet/src/org/restlet/engine/local/DirectoryServerResource.jav a =================================================================== --- modules/org.restlet/src/org/restlet/engine/local/DirectoryServerResource.jav a (revision 6055) +++ modules/org.restlet/src/org/restlet/engine/local/DirectoryServerResource.jav a (working copy) @@ -738,7 +738,7 @@ baseEntryName = fullEntryName; // Remove the extensions from the base name - firstDotIndex = fullEntryName.indexOf('.'); + firstDotIndex = fullEntryName.lastIndexOf('.'); if (firstDotIndex != -1) { baseEntryName = fullEntryName.substring(0, firstDotIndex); ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24405 06 ------------------------------------------------------ http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2449949
DirTest.java
Description: Binary data

