public Map<String, String> getReply() { // Compute expected reply String replytarget = this.target; replytarget = HTTPUtil.canonjoin(downloaddir, replytarget); if(replytarget == null) replytarget = ""; Map<String, String> map = new HashMap<String, String>(); map.put("download", replytarget); return map; }
/** * @param realpath path to this servlet's dir in webapps (typically nding in WEB-INF) * @param which parameter name to check: typically a relative path * @param dfalt for parameter * @return The absolute path froom the which directory(ending in '/'). */ private String getCachedString(String realpath, String which, String dfalt) { String dir = getInitParameter(which); if(dir == null) dir = dfalt; if(HTTPUtil.isAbsolutePath(dir)) dir = HTTPUtil.canonicalpath(dir); else dir = HTTPUtil.relpath(dir); dir = HTTPUtil.canonjoin(realpath,dir); if (!dir.endsWith("/")) dir += "/"; return (dir); }