From c57306f6204d599e421cd93888fcf79c558fd9e8 Mon Sep 17 00:00:00 2001 From: theli Date: Tue, 17 May 2005 06:17:02 +0000 Subject: [PATCH] *) Correcting Problem with Template Include - Unresolved filename git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@125 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/http/httpTemplate.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/http/httpTemplate.java b/source/de/anomic/http/httpTemplate.java index af85e6e93..3f77f3b46 100644 --- a/source/de/anomic/http/httpTemplate.java +++ b/source/de/anomic/http/httpTemplate.java @@ -56,7 +56,7 @@ import java.util.Hashtable; import de.anomic.server.serverFileUtils; -final class httpTemplate { +public final class httpTemplate { private static final byte hash = (byte)'#'; private static final byte[] hasha = {hash}; @@ -284,8 +284,9 @@ final class httpTemplate { if(transferUntil(pis, keyStream, iClose)){ String filename = keyStream.toString(); if(filename.startsWith( Character.toString((char)lbr) ) && filename.endsWith( Character.toString((char)rbr) )){ //simple pattern for filename - filename= new String(replacePattern( filename.substring(1, filename.length()-1), pattern, dflt)); + filename= new String(replacePattern( prefix + filename.substring(1, filename.length()-1), pattern, dflt)); } + if ((!filename.equals("")) && (!filename.equals(dflt))) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream( new File("htroot", filename) ))); //Read the Include @@ -298,9 +299,9 @@ final class httpTemplate { //e.printStackTrace(); } PushbackInputStream pis2 = new PushbackInputStream(new ByteArrayInputStream(include.getBytes())); - writeTemplate(pis2, out, pattern, dflt, prefix + "_"); + writeTemplate(pis2, out, pattern, dflt, prefix); } - + } }else{ //no match, but a single hash (output # + bb) byte[] tmp=new byte[2]; tmp[0]=hash;