diff --git a/htroot/CacheAdmin_p.java b/htroot/CacheAdmin_p.java index 10491a795..590df3b37 100644 --- a/htroot/CacheAdmin_p.java +++ b/htroot/CacheAdmin_p.java @@ -93,17 +93,19 @@ public class CacheAdmin_p { // generate dir listing String[] list = dir.list(); - File f; String tree = "Directory of
" + ((pathString.length() == 0) ? "domain list" : linkPathString(pathString)) + "

"; + File f; + StringBuffer tree = new StringBuffer(list.length * 200); + tree.append("Directory of
" + ((pathString.length() == 0) ? "domain list" : linkPathString(pathString)) + "

"); if (list == null) - tree += "[empty]"; + tree.append("[empty]"); else { for (int i = 0; i < list.length; i++) { f = new File(dir, list[i]); if (!f.getName().equalsIgnoreCase("responseHeader.db")) if (f.isDirectory()) - tree += "\"Folder\" " + list[i] + "
" + serverCore.crlfString; + tree.append("\"Folder\" " + list[i] + "
" + serverCore.crlfString); else - tree += "\"File\" " + list[i] + "
" + serverCore.crlfString; + tree.append("\"File\" " + list[i] + "
" + serverCore.crlfString); } } @@ -146,7 +148,7 @@ public class CacheAdmin_p { prop.put("cachesize", Long.toString(switchboard.cacheManager.currCacheSize/1024)); prop.put("cachemax", Long.toString(switchboard.cacheManager.maxCacheSize/1024)); - prop.put("tree", tree); + prop.put("tree", tree.toString()); prop.put("info", info); // return rewrite properties return prop;