protected String applyResourceNameMatcher (String uri) { if (resourceNamePattern != null) {// mangle resource name with the compiled pattern. Matcher matcher = resourceNamePattern.matcher(uri); String replaced; if (resourceNameReplaceAll) { replaced = matcher.replaceAll(resourceNameReplacement); } else { replaced = matcher.replaceFirst(resourceNameReplacement); } if (!uri.equals(replaced)) { if (verbose) { log("Replaced resource name \"" + uri + "\" with \"" + replaced + "\"."); } return replaced; } } return uri; }
protected void generateNamePrefixOnce () { URI uri = null; String realPath = servletContext.getRealPath("/"); if (realPath != null) { uri = new File(realPath).toURI();}//prevent NPE if in .war try { URL res = servletContext.getResource("/"); if (res != null) { uri = res.toURI(); } } catch (MalformedURLException ignore) { } catch (URISyntaxException ignore) { } if (uri != null) { try { namePrefix = uri.toURL().toExternalForm(); return; } catch (MalformedURLException e) { log("generateNamePrefixOnce [ERROR] Malformed URL for base path / == '"+ uri +'\'', e); } } namePrefix = ""; }
log("Parsing init parameters..."); Exception npex = new NullPointerException("resource.name.replacement"); String message = "Init-param 'resource.name.replacement' not specified!"; log(message, npex); throw new ServletException(message, npex); } else if ("EMPTY_STRING".equals(replacement)) {//<param-value></param-value> is prohibited log("(Abstract) init done. Listing some parameter name/value pairs:"); log("verbose = " + verbose); // this *is* verbose! ;) log("reflection = " + reflection); log("logGROOVY861 = " + logGROOVY861); log(INIT_PARAM_RESOURCE_NAME_REGEX + " = " + resourceNamePattern);//toString == pattern log("resource.name.replacement = " + resourceNameReplacement);
protected String applyResourceNameMatcher (String uri) { if (resourceNamePattern != null) {// mangle resource name with the compiled pattern. Matcher matcher = resourceNamePattern.matcher(uri); String replaced; if (resourceNameReplaceAll) { replaced = matcher.replaceAll(resourceNameReplacement); } else { replaced = matcher.replaceFirst(resourceNameReplacement); } if (!uri.equals(replaced)) { if (verbose) { log("Replaced resource name \"" + uri + "\" with \"" + replaced + "\"."); } return replaced; } } return uri; }
private String applyResourceNameMatcher(final String aUri) { /* * mangle resource name with the compiled pattern. */ String uri = aUri; Matcher matcher = resourceNameMatcher; if (matcher != null) { matcher.reset(uri); String replaced; if (resourceNameReplaceAll) { replaced = matcher.replaceAll(resourceNameReplacement); } else { replaced = matcher.replaceFirst(resourceNameReplacement); } if (!uri.equals(replaced)) { if (verbose) { log("Replaced resource name \"" + uri + "\" with \"" + replaced + "\"."); } uri = replaced; } } return uri; }
protected void generateNamePrefixOnce () { URI uri = null; String realPath = servletContext.getRealPath("/"); if (realPath != null) { uri = new File(realPath).toURI();}//prevent NPE if in .war try { URL res = servletContext.getResource("/"); if (res != null) { uri = res.toURI(); } } catch (MalformedURLException | URISyntaxException ignore) { } if (uri != null) { try { namePrefix = uri.toURL().toExternalForm(); return; } catch (MalformedURLException e) { log("generateNamePrefixOnce [ERROR] Malformed URL for base path / == '"+ uri +'\'', e); } } namePrefix = ""; }
log("Parsing init parameters..."); Exception npex = new NullPointerException("resource.name.replacement"); String message = "Init-param 'resource.name.replacement' not specified!"; log(message, npex); throw new ServletException(message, npex); log("(Abstract) init done. Listing some parameter name/value pairs:"); log("verbose = " + verbose); // this *is* verbose! ;) log("reflection = " + reflection); log("logGROOVY861 = " + logGROOVY861); if (resourceNameMatcher != null) { log("resource.name.regex = " + resourceNameMatcher.pattern().pattern()); } else { log("resource.name.regex = null"); log("resource.name.replacement = " + resourceNameReplacement);
log("Parsing init parameters..."); Exception npex = new NullPointerException("resource.name.replacement"); String message = "Init-param 'resource.name.replacement' not specified!"; log(message, npex); throw new ServletException(message, npex); log("(Abstract) init done. Listing some parameter name/value pairs:"); log("verbose = " + verbose); // this *is* verbose! ;) log("reflection = " + reflection); log("logGROOVY861 = " + logGROOVY861); if (resourceNameMatcher != null) { log("resource.name.regex = " + resourceNameMatcher.pattern().pattern()); log("resource.name.regex = null"); log("resource.name.replacement = " + resourceNameReplacement);
log("Parsing init parameters..."); Exception npex = new NullPointerException("resource.name.replacement"); String message = "Init-param 'resource.name.replacement' not specified!"; log(message, npex); throw new ServletException(message, npex); log("(Abstract) init done. Listing some parameter name/value pairs:"); log("verbose = " + verbose); // this *is* verbose! ;) log("reflection = " + reflection); log("logGROOVY861 = " + logGROOVY861); if (resourceNameMatcher != null) { log("resource.name.regex = " + resourceNameMatcher.pattern().pattern()); log("resource.name.regex = null"); log("resource.name.replacement = " + resourceNameReplacement);
log("Parsing init parameters..."); Exception npex = new NullPointerException("resource.name.replacement"); String message = "Init-param 'resource.name.replacement' not specified!"; log(message, npex); throw new ServletException(message, npex); log("(Abstract) init done. Listing some parameter name/value pairs:"); log("verbose = " + verbose); // this *is* verbose! ;) log("reflection = " + reflection); log("logGROOVY861 = " + logGROOVY861); if (resourceNameMatcher != null) { log("resource.name.regex = " + resourceNameMatcher.pattern().pattern()); log("resource.name.regex = null"); log("resource.name.replacement = " + resourceNameReplacement);
log("Parsing init parameters..."); Exception npex = new NullPointerException("resource.name.replacement"); String message = "Init-param 'resource.name.replacement' not specified!"; log(message, npex); throw new ServletException(message, npex); } else if ("EMPTY_STRING".equals(replacement)) {//<param-value></param-value> is prohibited log("(Abstract) init done. Listing some parameter name/value pairs:"); log("verbose = " + verbose); // this *is* verbose! ;) log("reflection = " + reflection); log("logGROOVY861 = " + logGROOVY861); log(INIT_PARAM_RESOURCE_NAME_REGEX + " = " + resourceNamePattern);//toString == pattern log("resource.name.replacement = " + resourceNameReplacement);
log("Replaced resource name \"" + name + "\" with \"" + replaced + "\".");
log("Replaced resource name \"" + name + "\" with \"" + replaced + "\".");
log("Replaced resource name \"" + name + "\" with \"" + replaced + "\".");