@@ -0,0 +1,1558 @@
+package stillness;%0D%0A%0D%0Aimport org.apache.velocity.runtime.resource.loader.FileResourceLoader;%0D%0Aimport org.apache.velocity.exception.ResourceNotFoundException;%0D%0A%0D%0Aimport java.io.InputStream;%0D%0Aimport java.io.BufferedReader;%0D%0Aimport java.io.InputStreamReader;%0D%0Aimport java.io.ByteArrayInputStream;%0D%0A%0D%0A/**%0D%0A * Created by IntelliJ IDEA.%0D%0A * User: marwan%0D%0A * Date: 8 juil. 2007%0D%0A * Time: 16:57:37%0D%0A * To change this template use File %7C Settings %7C File Templates.%0D%0A */%0D%0Apublic class StillnessResourceLoader extends FileResourceLoader %7B%0D%0A%0D%0A    /**%0D%0A     * On a juste besoin de surcharger cette methode. Pour le reste ca doit etre bon%0D%0A     * @param templateName%0D%0A     * @return%0D%0A     * @throws ResourceNotFoundException%0D%0A     */%0D%0A    public InputStream getResourceStream(String templateName)%0D%0A        throws ResourceNotFoundException%0D%0A    %7B%0D%0A        InputStream is = super.getResourceStream(templateName);%0D%0A%0D%0A        boolean normalize = true; // TODO%0D%0A        // a ce niveau is est forcement initialis ou on a leve une exception%0D%0A        if(normalize) %7B%0D%0A            try %7B%0D%0A                BufferedReader br = new BufferedReader(new InputStreamReader(is));%0D%0A                String src = %22%22;%0D%0A                String l = null;%0D%0A                while ((l = br.readLine()) != null) src += l;%0D%0A                src = StillnessUtil.normalize(src);%0D%0A                // On ne peut que passer par le ByteArray...%0D%0A                return new ByteArrayInputStream(src.getBytes());%0D%0A            %7D catch (Exception e) %7B%0D%0A%0D%0A            %7D%0D%0A        %7D%0D%0A        return is;%0D%0A    %7D%0D%0A%0D%0A%7D%0D%0A

add Stillness resource loader