/** * Normalize a relative URI path that may have relative values ("/./", * "/../", and so on ) it it. <strong>WARNING</strong> - This method is * useful only for normalizing application-generated paths. It does not * try to perform security checks for malicious input. * * @param path Relative path to be normalized */ public static String normalize(String path) { return normalize(path, true); }
/** * Return a context-relative path, beginning with a "/", that represents * the canonical version of the specified path after ".." and "." elements * are resolved out. If the specified path attempts to go outside the * boundaries of the current context (i.e. too many ".." path elements * are present), return <code>null</code> instead. * * @param path Path to be normalized */ protected String normalize(String path) { return RequestUtil.normalize(path, File.separatorChar == '\\'); }
/** * Return a context-relative path, beginning with a "/", that represents * the canonical version of the specified path after ".." and "." elements * are resolved out. If the specified path attempts to go outside the * boundaries of the current context (i.e. too many ".." path elements * are present), return <code>null</code> instead. * * @param path Path to be normalized */ protected String normalize(String path) { return RequestUtil.normalize(path, File.separatorChar == '\\'); }
/** * Normalize a relative URI path that may have relative values ("/./", * "/../", and so on ) it it. <strong>WARNING</strong> - This method is * useful only for normalizing application-generated paths. It does not * try to perform security checks for malicious input. * * @param path Relative path to be normalized */ public static String normalize(String path) { return normalize(path, true); }
/** * Return a context-relative path, beginning with a "/", that represents * the canonical version of the specified path after ".." and "." elements * are resolved out. If the specified path attempts to go outside the * boundaries of the current context (i.e. too many ".." path elements * are present), return <code>null</code> instead. * * @param path Path to be normalized */ protected String normalize(String path) { return RequestUtil.normalize(path, File.separatorChar == '\\'); }
/** * Normalize a relative URI path that may have relative values ("/./", * "/../", and so on ) it it. <strong>WARNING</strong> - This method is * useful only for normalizing application-generated paths. It does not * try to perform security checks for malicious input. * * @param path Relative path to be normalized */ public static String normalize(String path) { return normalize(path, true); }
/** * Normalize a relative URI path that may have relative values ("/./", * "/../", and so on ) it it. <strong>WARNING</strong> - This method is * useful only for normalizing application-generated paths. It does not * try to perform security checks for malicious input. * * @param path Relative path to be normalized */ public static String normalize(String path) { return normalize(path, true); }
/** * Normalize a relative URI path that may have relative values ("/./", * "/../", and so on ) it it. <strong>WARNING</strong> - This method is * useful only for normalizing application-generated paths. It does not * try to perform security checks for malicious input. * * @param path Relative path to be normalized */ public static String normalize(String path) { return normalize(path, true); }
/** * Normalize a relative URI path that may have relative values ("/./", * "/../", and so on ) it it. <strong>WARNING</strong> - This method is * useful only for normalizing application-generated paths. It does not * try to perform security checks for malicious input. * * @param path Relative path to be normalized */ public static String normalize(String path) { return normalize(path, true); }
protected static String normalize(String path) { return RequestUtil.normalize(path, File.separatorChar == '\\'); }
protected static String normalize(String path) { return RequestUtil.normalize(path, File.separatorChar == '\\'); }
/** * Return a context-relative path, beginning with a "/", that represents * the canonical version of the specified path after ".." and "." elements * are resolved out. If the specified path attempts to go outside the * boundaries of the current context (i.e. too many ".." path elements are * present), return <code>null</code> instead. This normalize should be * the same as DefaultServlet.normalize, which is almost the same ( see * source code below ) as RequestUtil.normalize. Do we need all this * duplication? * * @param path * Path to be normalized */ public static String normalize(String path) { return RequestUtil.normalize(path); } }
/** * Return a context-relative path, beginning with a "/", that represents * the canonical version of the specified path after ".." and "." elements * are resolved out. If the specified path attempts to go outside the * boundaries of the current context (i.e. too many ".." path elements are * present), return <code>null</code> instead. This normalize should be * the same as DefaultServlet.normalize, which is almost the same ( see * source code below ) as RequestUtil.normalize. Do we need all this * duplication? * * @param path * Path to be normalized */ public static String normalize(String path) { return RequestUtil.normalize(path); } }
/** * Return a context-relative path, beginning with a "/", that represents * the canonical version of the specified path after ".." and "." elements * are resolved out. If the specified path attempts to go outside the * boundaries of the current context (i.e. too many ".." path elements are * present), return <code>null</code> instead. This normalize should be * the same as DefaultServlet.normalize, which is almost the same ( see * source code below ) as RequestUtil.normalize. Do we need all this * duplication? * * @param path * Path to be normalized * @deprecated */ public static String normalize(String path) { return RequestUtil.normalize(path); } }
protected String getAbsolutePath(String path) throws IOException { String pathWithoutContext = SSIServletRequestUtil.getRelativePath(req); String prefix = getPathWithoutFileName(pathWithoutContext); if (prefix == null) { throw new IOException("Couldn't remove filename from path: " + pathWithoutContext); } String fullPath = prefix + path; String retVal = RequestUtil.normalize(fullPath); if (retVal == null) { throw new IOException("Normalization yielded null on path: " + fullPath); } return retVal; }
protected String getAbsolutePath(String path) throws IOException { String pathWithoutContext = SSIServletRequestUtil.getRelativePath(req); String prefix = getPathWithoutFileName(pathWithoutContext); if (prefix == null) { throw new IOException("Couldn't remove filename from path: " + pathWithoutContext); } String fullPath = prefix + path; String retVal = RequestUtil.normalize(fullPath); if (retVal == null) { throw new IOException("Normalization yielded null on path: " + fullPath); } return retVal; }
protected String getAbsolutePath(String path) throws IOException { String pathWithoutContext = SSIServletRequestUtil.getRelativePath(req); String prefix = getPathWithoutFileName(pathWithoutContext); if (prefix == null) { throw new IOException("Couldn't remove filename from path: " + pathWithoutContext); } String fullPath = prefix + path; String retVal = RequestUtil.normalize(fullPath); if (retVal == null) { throw new IOException("Normalization yielded null on path: " + fullPath); } return retVal; }
protected String getAbsolutePath(String path) throws IOException { String pathWithoutContext = SSIServletRequestUtil.getRelativePath(req); String prefix = getPathWithoutFileName(pathWithoutContext); if (prefix == null) { throw new IOException("Couldn't remove filename from path: " + pathWithoutContext); } String fullPath = prefix + path; String retVal = RequestUtil.normalize(fullPath); if (retVal == null) { throw new IOException("Normalization yielded null on path: " + fullPath); } return retVal; }
/** * Return a Set containing the resource paths of resources member of the * specified collection. Each path will be a String starting with * a "/" character. The returned set is immutable. * * @param path Collection path */ @Override public Set<String> getResourcePaths(String path) { // Validate the path argument if (path == null) { return null; } if (!path.startsWith("/")) { throw new IllegalArgumentException (sm.getString("applicationContext.resourcePaths.iae", path)); } String normalizedPath = RequestUtil.normalize(path); if (normalizedPath == null) return (null); DirContext resources = context.getResources(); if (resources != null) { return (getResourcePathsInternal(resources, normalizedPath)); } return (null); }
/** * Return a Set containing the resource paths of resources member of the * specified collection. Each path will be a String starting with * a "/" character. The returned set is immutable. * * @param path Collection path */ public Set getResourcePaths(String path) { // Validate the path argument if (path == null) { return null; } if (!path.startsWith("/")) { throw MESSAGES.invalidDispatcherPath(path); } path = RequestUtil.normalize(path); if (path == null) return (null); DirContext resources = context.getResources(); if (resources != null) { return (getResourcePathsInternal(resources, path)); } return (null); }