@Override @SuppressWarnings("unchecked") protected ArrayList list(File file) { ArrayList entries = super.list(file); // adds virtual tlds for WEB-INF listing if ("WEB-INF".equals(file.getName())) { entries.addAll(getVirtualNamingEntries()); } return entries; }
/** * Scan a given dir for tld files. Any found tld will be added to the * virtualMappings. * @param dir Dir to scan for tlds */ private void scanForTlds(File dir) { File[] files = dir.listFiles(); for (int j = 0; j < files.length; j++) { File file = files[j]; if (file.isDirectory()) { scanForTlds(file); } else if (file.getName().endsWith(".tld")) { // just generate a random name using the current timestamp, name // doesn't matter since it needs to be referenced by URI String virtualTldName = "~" + System.currentTimeMillis() + "~" + file.getName(); virtualMappings.put(virtualTldName, file); } } }
@Override protected String doGetRealPath(String path) { File file = file(path); if (null != file) { return file.getAbsolutePath(); } else { return null; } } }
if (absPath.startsWith(getDocBase() + File.separator)) { String relPath = absPath.substring(getDocBase().length()); String fsRelPath = relPath.replace(File.separatorChar, '/'); for (Map.Entry<String, List<String>> mapping : mappedResourcePaths.entrySet()) {
if (absPath.startsWith(getDocBase() + File.separator)) { String relPath = absPath.substring(getDocBase().length()); String fsRelPath = relPath.replace(File.separatorChar, '/'); for (Map.Entry<String, List<String>> mapping : mappedResourcePaths.entrySet()) {
/** * Scan a given dir for tld files. Any found tld will be added to the * virtualMappings. * @param dir Dir to scan for tlds */ private void scanForTlds(File dir) { File[] files = dir.listFiles(); for (int j = 0; j < files.length; j++) { File file = files[j]; if (file.isDirectory()) { scanForTlds(file); } else if (file.getName().endsWith(".tld")) { // just generate a random name using the current timestamp, name // doesn't matter since it needs to be referenced by URI String virtualTldName = "~" + System.currentTimeMillis() + "~" + file.getName(); virtualMappings.put(virtualTldName, file); } } }
@Override @SuppressWarnings("unchecked") protected ArrayList list(File file) { ArrayList entries = super.list(file); // adds virtual tlds for WEB-INF listing if ("WEB-INF".equals(file.getName())) { entries.addAll(getVirtualNamingEntries()); } return entries; }
/** * Scan a given dir for tld files. Any found tld will be added to the * virtualMappings. * @param dir Dir to scan for tlds */ private void scanForTlds(File dir) { File[] files = dir.listFiles(); for (int j = 0; j < files.length; j++) { File file = files[j]; if (file.isDirectory()) { scanForTlds(file); } else if (file.getName().endsWith(".tld")) { // just generate a random name using the current timestamp, name // doesn't matter since it needs to be referenced by URI String virtualTldName = "~" + System.currentTimeMillis() + "~" + file.getName(); virtualMappings.put(virtualTldName, file); } } }
@Override protected ArrayList<NamingEntry> list(File file) { ArrayList<NamingEntry> entries = super.list(file); // adds virtual tlds for WEB-INF listing if ("WEB-INF".equals(file.getName())) { entries.addAll(getVirtualNamingEntries()); } return entries; }
/** * Scan a given dir for tld files. Any found tld will be added to the * virtualMappings. * @param dir Dir to scan for tlds */ private void scanForTlds(File dir) { File[] files = dir.listFiles(); for (int j = 0; j < files.length; j++) { File file = files[j]; if (file.isDirectory()) { scanForTlds(file); } else if (file.getName().endsWith(".tld")) { // just generate a random name using the current timestamp, name // doesn't matter since it needs to be referenced by URI String virtualTldName = "~" + System.currentTimeMillis() + "~" + file.getName(); virtualMappings.put(virtualTldName, file); } } }
@Override protected ArrayList<NamingEntry> list(File file) { ArrayList<NamingEntry> entries = super.list(file); // adds virtual tlds for WEB-INF listing if ("WEB-INF".equals(file.getName())) { entries.addAll(getVirtualNamingEntries()); } return entries; }
/** * Scan a given dir for tld files. Any found tld will be added to the * virtualMappings. * @param dir Dir to scan for tlds */ private void scanForTlds(File dir) { File[] files = dir.listFiles(); for (int j = 0; j < files.length; j++) { File file = files[j]; if (file.isDirectory()) { scanForTlds(file); } else if (file.getName().endsWith(".tld")) { // just generate a random name using the current timestamp, name // doesn't matter since it needs to be referenced by URI String virtualTldName = "~" + System.currentTimeMillis() + "~" + file.getName(); virtualMappings.put(virtualTldName, file); } } }
@Override protected ArrayList<NamingEntry> list(File file) { ArrayList<NamingEntry> entries = super.list(file); // adds virtual tlds for WEB-INF listing if ("WEB-INF".equals(file.getName())) { entries.addAll(getVirtualNamingEntries()); } return entries; }
/** * {@inheritDoc} */ @Override public void allocate() { super.allocate(); virtualMappings = new Hashtable<String, File>(); tagfileMappings = new Hashtable<String, File>(); // looks into any META-INF dir found in classpath entries for tld files. StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); while (tkn.hasMoreTokens()) { File file = new File(tkn.nextToken(), "META-INF"); if (!file.exists() || !file.isDirectory()) { continue; } scanForTlds(file); } }
/** * {@inheritDoc} */ @Override public void allocate() { super.allocate(); virtualMappings = new Hashtable<String, File>(); tagfileMappings = new Hashtable<String, File>(); // looks into any META-INF dir found in classpath entries for tld files. StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); while (tkn.hasMoreTokens()) { File file = new File(tkn.nextToken(), "META-INF"); if (!file.exists() || !file.isDirectory()) { continue; } scanForTlds(file); } }
/** * {@inheritDoc} */ @Override public void allocate() { super.allocate(); virtualMappings = new Hashtable<String, File>(); tagfileMappings = new Hashtable<String, File>(); // looks into any META-INF dir found in classpath entries for tld files. StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); while (tkn.hasMoreTokens()) { File file = new File(tkn.nextToken(), "META-INF"); if (!file.exists() || !file.isDirectory()) { continue; } scanForTlds(file); } }
/** * {@inheritDoc} */ @Override public void allocate() { super.allocate(); virtualMappings = new Hashtable<String, File>(); tagfileMappings = new Hashtable<String, File>(); // looks into any META-INF dir found in classpath entries for tld files. StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); while (tkn.hasMoreTokens()) { File file = new File(tkn.nextToken(), "META-INF"); if (!file.exists() || !file.isDirectory()) { continue; } scanForTlds(file); } }
/** * {@inheritDoc} */ @Override public void allocate() { super.allocate(); virtualMappings = new Hashtable<String, File>(); tagfileMappings = new Hashtable<String, File>(); // looks into any META-INF dir found in classpath entries for tld files. StringTokenizer tkn = new StringTokenizer(virtualClasspath, ";"); while (tkn.hasMoreTokens()) { File file = new File(tkn.nextToken(), "META-INF"); if (!file.exists() || !file.isDirectory()) { continue; } scanForTlds(file); } }