@Override public void init( ServletConfig servletConfig ) throws ServletException { super.init( servletConfig ); initServers( servletConfig ); }
@Override public void init( ServletConfig servletConfig ) throws ServletException { super.init( servletConfig ); try { initServers( servletConfig ); } catch ( RepositoryAdminException e ) { log.error( e.getMessage(), e ); throw new ServletException( e.getMessage(), e ); } }
/** * Init this servlet * * @throws ServletException */ @Override public void init() throws ServletException { super.init(); resourcePathPrefix = getInitParameter(INIT_PARAM_RESOURCE_PATH_PREFIX); if (resourcePathPrefix == null) { log.debug("Missing path prefix > setting to empty string."); resourcePathPrefix = ""; } else if (resourcePathPrefix.endsWith("/")) { log.debug("Path prefix ends with '/' > removing trailing slash."); resourcePathPrefix = resourcePathPrefix.substring(0, resourcePathPrefix.length() - 1); } getServletContext().setAttribute(CTX_ATTR_RESOURCE_PATH_PREFIX, resourcePathPrefix); log.info(INIT_PARAM_RESOURCE_PATH_PREFIX + " = '" + resourcePathPrefix + "'"); config = new ResourceConfig(getDetector()); String configParam = getInitParameter(INIT_PARAM_RESOURCE_CONFIG); if (configParam != null) { try { config.parse(getServletContext().getResource(configParam)); } catch (MalformedURLException e) { log.debug("Unable to build resource filter provider", e); } } }
/** * Initializes the servlet set reads the following parameter from the * servlet configuration: * <ul> * <li>resource-path-prefix: optional prefix for all resources.</li> * </ul> * * @throws ServletException */ @Override public void init() throws ServletException { super.init(); // set resource path prefix pathPrefix = getInitParameter(INIT_PARAM_RESOURCE_PATH_PREFIX); getServletContext().setAttribute(CTX_ATTR_RESOURCE_PATH_PREFIX, pathPrefix); log.debug(INIT_PARAM_RESOURCE_PATH_PREFIX + " = " + pathPrefix); txMgr = new TxLockManagerImpl(); subscriptionMgr = new SubscriptionManagerImpl(); txMgr.addTransactionListener((SubscriptionManagerImpl) subscriptionMgr); // todo: eventually make configurable resourceFactory = new DavResourceFactoryImpl(txMgr, subscriptionMgr); locatorFactory = new DavLocatorFactoryImpl(pathPrefix); }
@Override public void init() throws ServletException { super.init(); setLocatorFactory(new LocatorFactoryImplEx("")); setResourceFactory(new XWikiDavResourceFactory(getServletContext())); setDavSessionProvider(new XWikiDavSessionProvider()); }