/** * @see org.apache.wicket.markup.html.IPackageResourceGuard#accept(java.lang.Class, * java.lang.String) */ public boolean accept(Class<?> scope, String path) { IPackageResourceGuard guard = Application.get() .getResourceSettings() .getPackageResourceGuard(); return guard.accept(scope, path); }
public void init(Application application) { application.getRootRequestMapperAsCompound().add(new TinyMceRequestMapper()); // Resource Package Guard security settings to fix .htm file problem IPackageResourceGuard packageResourceGuard = application.getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; guard.addPattern("+wicket/contrib/tinymce/tiny_mce/**/*.htm"); } }
.getPackageResourceGuard(); if (!guard.accept(scope, path))
/** * updates the security manager to allow fonts and less files if necessary. * * @param app The current application * @param settings The settings to use */ private static void updateSecurityManager(final Application app, final IBootstrapSettings settings) { final IPackageResourceGuard packageResourceGuard = app.getResourceSettings().getPackageResourceGuard(); if (packageResourceGuard instanceof SecurePackageResourceGuard) { SecurePackageResourceGuard guard = (SecurePackageResourceGuard) packageResourceGuard; guard.addPattern("+*.woff"); guard.addPattern("+*.eot"); guard.addPattern("+*.svg"); guard.addPattern("+*.ttf"); if (settings.getBootstrapLessCompilerSettings().useLessCompiler()) { guard.addPattern("+*.less"); } } }