public static long findBestPath(Path path) { long max = 0, sum = 0; if (path.getChildren().size() == 0) return path.getValue(); else { for (int i = 0; i < path.getChildren().size(); i++) { sum = path.getValue() + findBestPath(path.getChildren().get(i)); if (sum > max) max = sum; } return max; } }
/** * Find a package specific status template * * @param scriptPath Path * @param statusCode int * @param format String * @return status template (or null, if not found) */ private StatusTemplate getPackageStatusTemplate(Path scriptPath, int statusCode, String format) { while(scriptPath != null) { String path = PathImpl.concatPath(scriptPath.getPath(), format + "." + statusCode + ".ftl"); String validTemplatePath = container.getTemplateProcessorRegistry().findValidTemplatePath(path); if (validTemplatePath != null) { return new StatusTemplate(path, format); } path = PathImpl.concatPath(scriptPath.getPath(), format + ".status.ftl"); validTemplatePath = container.getTemplateProcessorRegistry().findValidTemplatePath(path); if (validTemplatePath != null) { return new StatusTemplate(path, format); } scriptPath = scriptPath.getParent(); } return null; }
PathImpl filteredPath = filteredParent == null ? new PathImpl(path.getPath()) : filteredParent.createChildPath(path.getName()); for (WebScript script : path.getScripts()) for (Path child : path.getChildren())
String scriptPackagePath = this.getPackage().getPath(); if (scriptIds != null)
public static long findBestPath(Path path) { long max = 0, sum = 0; if (path.getChildren().size() == 0) return 0; else { for (int i = 0; i < path.getChildren().size(); i++) { sum = path.getChildren().get(i).getValue() + findBestPath(path.getChildren().get(i)); if (sum > max) max = sum; } return max; } }
WebScript[] webscripts = path.getScripts(); for (WebScript webscript : webscripts)
/** * Find a package specific status template * * @param scriptPath Path * @param statusCode int * @param format String * @return status template (or null, if not found) */ private StatusTemplate getPackageStatusTemplate(Path scriptPath, int statusCode, String format) { while(scriptPath != null) { String path = PathImpl.concatPath(scriptPath.getPath(), format + "." + statusCode + ".ftl"); String validTemplatePath = container.getTemplateProcessorRegistry().findValidTemplatePath(path); if (validTemplatePath != null) { return new StatusTemplate(path, format); } path = PathImpl.concatPath(scriptPath.getPath(), format + ".status.ftl"); validTemplatePath = container.getTemplateProcessorRegistry().findValidTemplatePath(path); if (validTemplatePath != null) { return new StatusTemplate(path, format); } scriptPath = scriptPath.getParent(); } return null; }
String scriptPackagePath = this.getPackage().getPath(); if (scriptIds != null)
/** * Find a package specific status template * * @param scriptPath * @param statusCode * @param format * @return status template (or null, if not found) */ private StatusTemplate getPackageStatusTemplate(Path scriptPath, int statusCode, String format) { while(scriptPath != null) { String path = PathImpl.concatPath(scriptPath.getPath(), format + "." + statusCode + ".ftl"); String validTemplatePath = container.getTemplateProcessorRegistry().findValidTemplatePath(path); if (validTemplatePath != null) { return new StatusTemplate(path, format); } path = PathImpl.concatPath(scriptPath.getPath(), format + ".status.ftl"); validTemplatePath = container.getTemplateProcessorRegistry().findValidTemplatePath(path); if (validTemplatePath != null) { return new StatusTemplate(path, format); } scriptPath = scriptPath.getParent(); } return null; }
String scriptPackagePath = this.getPackage().getPath(); if (scriptIds != null)