You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by ju...@apache.org on 2001/04/09 16:41:28 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav WebdavServlet.java
juergen 01/04/09 07:41:28
Modified: src/share/org/apache/slide/common Domain.java
src/manager/org/apache/slide/manager ManagerServlet.java
src/webdav/server/org/apache/slide/webdav WebdavServlet.java
Log:
domain contains now a method getDomainFileName() returning the expanded file name of domain.xml.
Revision Changes Path
1.20 +127 -25 jakarta-slide/src/share/org/apache/slide/common/Domain.java
Index: Domain.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Domain.java 2001/03/19 16:40:26 1.19
+++ Domain.java 2001/04/09 14:41:22 1.20
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v 1.19 2001/03/19 16:40:26 juergen Exp $
- * $Revision: 1.19 $
- * $Date: 2001/03/19 16:40:26 $
+ * $Header: /home/cvs/jakarta-slide/src/share/org/apache/slide/common/Domain.java,v 1.20 2001/04/09 14:41:22 juergen Exp $
+ * $Revision: 1.20 $
+ * $Date: 2001/04/09 14:41:22 $
*
* ====================================================================
*
@@ -69,6 +69,7 @@
import java.util.Properties;
import java.io.FileReader;
import java.io.FileInputStream;
+import java.io.InputStream;
import java.io.Reader;
import java.io.IOException;
import org.apache.slide.structure.*;
@@ -88,7 +89,7 @@
* For now, does not implement access control on Namespaces.
*
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
- * @version $Revision: 1.19 $
+ * @version $Revision: 1.20 $
*/
public final class Domain {
@@ -190,10 +191,78 @@
return null;
}
+ /**
+ * holds the expanded file name of domain.xml
+ **/
+ private static String domainFileName = null;
+
+ /**
+ * Access the file name of domain.xml.
+ *
+ * @return String the expanded file name as a string.
+ */
+ public static String getDomainFileName() {
+ return domainFileName;
+ }
+
+
+
+ /**
+ * Domain initialization routine using Avalon configuration parser.
+ *
+ * @param configurationURL The file name to read the configuration
+ */
+ public static void init(java.net.URL configurationURL) throws Exception {
+ if (isInitialized())
+ return;
+
+ domainFileName = configurationURL.getFile();
+ init(configurationURL.openStream());
+ }
/**
* Domain initialization routine using Avalon configuration parser.
*
+ * @param configurationInputStream The file name to read the configuration
+ */
+ public static void init(String configurationFileName) throws Exception {
+ if (isInitialized())
+ return;
+
+ domainFileName = configurationFileName;
+ init(new FileInputStream(configurationFileName));
+ }
+
+
+ /**
+ * Domain initialization routine using Avalon configuration parser.
+ *
+ * @param configurationInputStream The file name to read the configuration
+ */
+ public static void init(InputStream configurationInputStream)throws Exception {
+ if (isInitialized())
+ return;
+
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(false);
+ factory.setValidating(false);
+ SAXParser parser = factory.newSAXParser();
+ Populate pop = new Populate();
+ Configuration slideConfiguration =
+ new ConfigurationElement(pop.load(new InputSource(configurationInputStream),
+ parser.getParser()));
+
+ Domain.init(slideConfiguration);
+
+ }
+
+
+
+
+
+ /**
+ * Domain initialization routine using Avalon configuration parser.
+ *
* @param configuration Avalon configuration object
*/
public static void init(Configuration configuration) {
@@ -204,11 +273,13 @@
if (isInitialized())
return;
+
+
if (logger == null) {
try {
logger = (Logger) (Class.forName(loggerClass).newInstance());
logger.setLoggerLevel(configuration.getAttributeAsInt
- ("logger-level", Logger.INFO));
+ ("logger-level", Logger.INFO));
} catch (Exception e) {
e.printStackTrace();
throw new DomainInitializationFailedError
@@ -331,7 +402,7 @@
public static void warn(Object data) {
log(data, Logger.WARNING);
}
-
+
/**
* Check if the channel with the specified level is enabled for logging.
@@ -340,28 +411,28 @@
* @param channel The channel specification
* @param level The level specification
*/
-
+
public static boolean isEnabled(String channel, int level) {
return logger.isEnabled(channel, level);
}
-
-
+
+
/**
* Check if the default channel with the specified level is enabled for logging.
*
* @param level The level specification
*/
-
+
public static boolean isEnabled(int level) {
return logger.isEnabled(level);
}
-
+
/**
* Check if the default channel with the DEBUG level is enabled for logging.
*/
-
+
public static boolean isDebugEnabled() {
return isEnabled(logger.DEBUG);
}
@@ -369,7 +440,7 @@
/**
* Check if the default channel with the WARNING level is enabled for logging.
*/
-
+
public static boolean isWarningEnabled() {
return isEnabled(logger.WARNING);
}
@@ -377,7 +448,7 @@
/**
* Check if the default channel with the INFO level is enabled for logging.
*/
-
+
public static boolean isInfoEnabled() {
return isEnabled(logger.INFO);
}
@@ -385,14 +456,14 @@
/**
* Check if the default channel with the ERROR level is enabled for logging.
*/
-
+
public static boolean isErrorEnabled() {
return isEnabled(logger.ERROR);
}
-
+
// -------------------------------------------------------- Package Methods
@@ -474,12 +545,12 @@
try {
logger = (Logger)(Class.forName(loggerClass).newInstance());
logger.setLoggerLevel(Logger.INFO);
- }
- catch (Exception e) {
- e.printStackTrace();
- throw new DomainInitializationFailedError("Logger Problem: " + e.toString());
- }
-
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ throw new DomainInitializationFailedError("Logger Problem: " + e.toString());
+ }
+
}
info("Auto-Initializing Domain");
@@ -538,7 +609,7 @@
try {
info("Initializing namespace : "
- + configuration.getAttribute("name"));
+ + configuration.getAttribute("name"));
} catch (ConfigurationException e) {
e.printStackTrace();
}
@@ -551,7 +622,7 @@
namespaceLogger =
(Logger) (Class.forName(loggerClass).newInstance());
namespaceLogger.setLoggerLevel(configuration.getAttributeAsInt
- ("logger-level", Logger.INFO));
+ ("logger-level", Logger.INFO));
} catch (Exception e) {
e.printStackTrace();
}
@@ -579,6 +650,37 @@
namespace.loadConfiguration(namespaceConfigurationDefinition);
+
+
+
+ // preparation to add services, please ignore now
+ try {
+ Configuration services = configuration.getConfiguration("services");
+ Enumeration s = services.getConfigurations("service");
+ while (s.hasMoreElements()) {
+ Configuration service = (Configuration)s.nextElement();
+ System.out.println("&&&&&&Name = " + service.getName());
+ System.out.println("&&&&&&className = " + service.getAttribute("classname"));
+ System.out.println("&&&&&&serviceName = " + service.getAttribute("name"));
+ Enumeration s_pars = service.getConfigurations("parameter");
+ while (s_pars.hasMoreElements()) {
+ Configuration s_par = (Configuration)s_pars.nextElement();
+ System.out.println("&&&&&&PAR Name = " + s_par.getName());
+ System.out.println("&&&&&&PAR Name = " + s_par.getAttribute("name"));
+ System.out.println("&&&&&&Par Val = " + s_par.getValue());
+ }
+ }
+ }
+ catch (ConfigurationException e){
+ // silently ignore it ==> no services
+ }
+ catch (Exception e){
+ e.printStackTrace();
+ }
+ // preparation to add services, please ignore now
+
+
+
info("Namespace configuration complete");
} catch (Throwable t) {
@@ -586,6 +688,6 @@
}
}
-
+
}
1.4 +126 -144 jakarta-slide/src/manager/org/apache/slide/manager/ManagerServlet.java
Index: ManagerServlet.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/manager/org/apache/slide/manager/ManagerServlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ManagerServlet.java 2001/03/23 05:08:52 1.3
+++ ManagerServlet.java 2001/04/09 14:41:24 1.4
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/manager/org/apache/slide/manager/ManagerServlet.java,v 1.3 2001/03/23 05:08:52 remm Exp $
- * $Revision: 1.3 $
- * $Date: 2001/03/23 05:08:52 $
+ * $Header: /home/cvs/jakarta-slide/src/manager/org/apache/slide/manager/ManagerServlet.java,v 1.4 2001/04/09 14:41:24 juergen Exp $
+ * $Revision: 1.4 $
+ * $Date: 2001/04/09 14:41:24 $
*
* ====================================================================
*
* The Apache Software License, Version 1.1
*
- * Copyright (c) 1999 The Apache Software Foundation. All rights
+ * Copyright (c) 1999 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -15,7 +15,7 @@
* are met:
*
* 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
@@ -23,15 +23,15 @@
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowlegement:
- * "This product includes software developed by the
+ * any, must include the following acknowlegement:
+ * "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
- * from this software without prior written permission. For written
+ * from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache"
@@ -59,7 +59,7 @@
*
* [Additional notices, if required by prior licensing conditions]
*
- */
+ */
package org.apache.slide.manager;
@@ -84,7 +84,7 @@
/**
* Manager Servlet.
- *
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
*/
public class ManagerServlet extends HttpServlet {
@@ -102,7 +102,7 @@
/**
* Date formatter.
*/
- protected static final DateFormat formatter =
+ protected static final DateFormat formatter =
new SimpleDateFormat(DATE_FORMAT);
@@ -128,91 +128,91 @@
* Show HTTP header information.
*/
private void showRequestInfo(HttpServletRequest req) {
-
- System.out.println();
- System.out.println("SlideDAV Request Info");
- System.out.println();
-
- // Show generic info
- System.out.println("Encoding : " + req.getCharacterEncoding());
- System.out.println("Length : " + req.getContentLength());
- System.out.println("Type : " + req.getContentType());
-
- System.out.println();
- System.out.println("Parameters");
-
- Enumeration parameters = req.getParameterNames();
-
- while (parameters.hasMoreElements()) {
- String paramName = (String) parameters.nextElement();
- String[] values = req.getParameterValues(paramName);
- System.out.print(paramName + " : ");
- for (int i = 0; i < values.length; i++) {
- System.out.print(values[i] + ", ");
- }
- System.out.println();
- }
-
- System.out.println();
-
- System.out.println("Protocol : " + req.getProtocol());
- System.out.println("Address : " + req.getRemoteAddr());
- System.out.println("Host : " + req.getRemoteHost());
- System.out.println("Scheme : " + req.getScheme());
- System.out.println("Server Name : " + req.getServerName());
- System.out.println("Server Port : " + req.getServerPort());
-
- System.out.println();
- System.out.println("Attributes");
-
- Enumeration attributes = req.getAttributeNames();
-
- while (attributes.hasMoreElements()) {
- String attributeName = (String) attributes.nextElement();
- System.out.print(attributeName + " : ");
- System.out.println(req.getAttribute(attributeName).toString());
- }
-
- System.out.println();
-
- // Show HTTP info
- System.out.println();
- System.out.println("HTTP Header Info");
- System.out.println();
-
- System.out.println("Authentication Type : " + req.getAuthType());
- System.out.println("HTTP Method : " + req.getMethod());
- System.out.println("Path Info : " + req.getPathInfo());
- System.out.println("Path translated : " + req.getPathTranslated());
- System.out.println("Query string : " + req.getQueryString());
- System.out.println("Remote user : " + req.getRemoteUser());
- System.out.println("Requested session id : "
- + req.getRequestedSessionId());
- System.out.println("Request URI : " + req.getRequestURI());
- System.out.println("Context path : " + req.getContextPath());
+
+ System.out.println();
+ System.out.println("SlideDAV Request Info");
+ System.out.println();
+
+ // Show generic info
+ System.out.println("Encoding : " + req.getCharacterEncoding());
+ System.out.println("Length : " + req.getContentLength());
+ System.out.println("Type : " + req.getContentType());
+
+ System.out.println();
+ System.out.println("Parameters");
+
+ Enumeration parameters = req.getParameterNames();
+
+ while (parameters.hasMoreElements()) {
+ String paramName = (String) parameters.nextElement();
+ String[] values = req.getParameterValues(paramName);
+ System.out.print(paramName + " : ");
+ for (int i = 0; i < values.length; i++) {
+ System.out.print(values[i] + ", ");
+ }
+ System.out.println();
+ }
+
+ System.out.println();
+
+ System.out.println("Protocol : " + req.getProtocol());
+ System.out.println("Address : " + req.getRemoteAddr());
+ System.out.println("Host : " + req.getRemoteHost());
+ System.out.println("Scheme : " + req.getScheme());
+ System.out.println("Server Name : " + req.getServerName());
+ System.out.println("Server Port : " + req.getServerPort());
+
+ System.out.println();
+ System.out.println("Attributes");
+
+ Enumeration attributes = req.getAttributeNames();
+
+ while (attributes.hasMoreElements()) {
+ String attributeName = (String) attributes.nextElement();
+ System.out.print(attributeName + " : ");
+ System.out.println(req.getAttribute(attributeName).toString());
+ }
+
+ System.out.println();
+
+ // Show HTTP info
+ System.out.println();
+ System.out.println("HTTP Header Info");
+ System.out.println();
+
+ System.out.println("Authentication Type : " + req.getAuthType());
+ System.out.println("HTTP Method : " + req.getMethod());
+ System.out.println("Path Info : " + req.getPathInfo());
+ System.out.println("Path translated : " + req.getPathTranslated());
+ System.out.println("Query string : " + req.getQueryString());
+ System.out.println("Remote user : " + req.getRemoteUser());
+ System.out.println("Requested session id : "
+ + req.getRequestedSessionId());
+ System.out.println("Request URI : " + req.getRequestURI());
+ System.out.println("Context path : " + req.getContextPath());
System.out.println("Servlet path : " + req.getServletPath());
System.out.println("User principal : " + req.getUserPrincipal());
+
+
+ System.out.println();
+ System.out.println("Headers : ");
+
+ Enumeration headers = req.getHeaderNames();
-
- System.out.println();
- System.out.println("Headers : ");
-
- Enumeration headers = req.getHeaderNames();
-
- while (headers.hasMoreElements()) {
- String headerName = (String) headers.nextElement();
- System.out.print(headerName + " : ");
- System.out.println(req.getHeader(headerName));
- }
-
- // Show session info
- HttpSession session = req.getSession(false);
-
- System.out.println();
- System.out.println("End Request Info");
- System.out.println();
- System.out.println();
-
+ while (headers.hasMoreElements()) {
+ String headerName = (String) headers.nextElement();
+ System.out.print(headerName + " : ");
+ System.out.println(req.getHeader(headerName));
+ }
+
+ // Show session info
+ HttpSession session = req.getSession(false);
+
+ System.out.println();
+ System.out.println("End Request Info");
+ System.out.println();
+ System.out.println();
+
}
@@ -230,7 +230,7 @@
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response)
- throws IOException, ServletException {
+ throws IOException, ServletException {
response.setStatus(HttpServletResponse.SC_OK);
@@ -272,14 +272,14 @@
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response)
- throws IOException, ServletException {
+ throws IOException, ServletException {
doGet(request, response);
}
-
-
-
+
+
+
/**
* Manages some initialization stuff on the server.
*/
@@ -289,21 +289,21 @@
String domainConfigFile = "/Domain.xml";
String value = null;
- try {
- value = getServletConfig().getInitParameter("domain");
+ try {
+ value = getServletConfig().getInitParameter("domain");
if (value != null)
domainConfigFile = value;
} catch (Throwable t) {
- ;
- }
- try {
+ ;
+ }
+ try {
value = getServletConfig().getInitParameter("permissioneditor");
if (value != null)
permissionEditor = value;
} catch (Throwable t) {
;
}
- try {
+ try {
value = getServletConfig().getInitParameter("usereditor");
if (value != null)
userEditor = value;
@@ -311,31 +311,13 @@
;
}
- if (!Domain.isInitialized()) {
+ try {
- try {
-
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(false);
- factory.setValidating(false);
- SAXParser parser = factory.newSAXParser();
-
- InputStream is =
- getServletContext().getResourceAsStream(domainConfigFile);
- if (is == null)
- throw new ServletException("Can't find init file");
- Populate pop = new Populate();
- Configuration slideConfiguration =
- new ConfigurationElement(pop.load(new InputSource(is),
- parser.getParser()));
-
- Domain.init(slideConfiguration);
-
- } catch (Throwable t) {
- t.printStackTrace();
- throw new ServletException(t.getMessage());
- }
+ Domain.init(getServletContext().getResource(domainConfigFile).getFile());
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw new ServletException(t.getMessage());
}
}
@@ -356,7 +338,7 @@
*/
protected void removeACL(HttpServletRequest request,
HttpServletResponse response)
- throws IOException, ServletException {
+ throws IOException, ServletException {
// Retrieving request's attributes
@@ -389,7 +371,7 @@
try {
- NamespaceAccessToken nat =
+ NamespaceAccessToken nat =
Domain.accessNamespace(new SecurityToken(this), namespaceName);
Principal principal = request.getUserPrincipal();
CredentialsToken credToken = null;
@@ -399,14 +381,14 @@
credToken = new CredentialsToken("");
}
SlideToken token = new SlideToken(credToken);
- ObjectNode object =
+ ObjectNode object =
nat.getStructureHelper().retrieve(token, objectUri);
SubjectNode subject = (SubjectNode)
nat.getStructureHelper().retrieve(token, subjectUri);
ActionNode action = (ActionNode)
nat.getStructureHelper().retrieve(token, actionUri);
- nat.getSecurityHelper().revokePermission(token, object,
- subject, action);
+ nat.getSecurityHelper().revokePermission(token, object,
+ subject, action);
} catch (AccessDeniedException e) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
@@ -435,7 +417,7 @@
*/
protected void addACL(HttpServletRequest request,
HttpServletResponse response)
- throws IOException, ServletException {
+ throws IOException, ServletException {
// Retrieving request's attributes
@@ -501,7 +483,7 @@
if (permissionEditor != null) {
// Redirect to the edit page
- String editorUrl = permissionEditor + "?namespace="
+ String editorUrl = permissionEditor + "?namespace="
+ namespaceName;
if (objectUri != null) {
editorUrl += "&object=" + objectUri;
@@ -518,7 +500,7 @@
} else {
// Display a simple edit page
- displayPermissionEditor(request, response, namespaceName,
+ displayPermissionEditor(request, response, namespaceName,
objectUri, subjectUri, actionUri);
return;
@@ -526,14 +508,14 @@
} else {
- NodePermission permission =
- new NodePermission(objectUri, subjectUri, actionUri,
+ NodePermission permission =
+ new NodePermission(objectUri, subjectUri, actionUri,
inheritable);
try {
- NamespaceAccessToken nat =
- Domain.accessNamespace(new SecurityToken(this),
+ NamespaceAccessToken nat =
+ Domain.accessNamespace(new SecurityToken(this),
namespaceName);
Principal principal = request.getUserPrincipal();
CredentialsToken credToken = null;
@@ -614,11 +596,11 @@
}
writer.print("><br>");
writer.print("Inheritable : <INPUT TYPE=\"text\" "
- + "NAME=\"inheritable\" value=\"true\"><br>");
- writer.print("Negative : <INPUT TYPE=\"text\" NAME=\"negative\" "
- + "value=\"false\"><br>");
- writer.print("<input type=\"hidden\" name=\"command\" "
- + "value=\"addacl\">");
+ + "NAME=\"inheritable\" value=\"true\"><br>");
+ writer.print("Negative : <INPUT TYPE=\"text\" NAME=\"negative\" "
+ + "value=\"false\"><br>");
+ writer.print("<input type=\"hidden\" name=\"command\" "
+ + "value=\"addacl\">");
writer.print("<input type=\"submit\" value=\"Add\">");
writer.print("</form></body></html>");
1.11 +22 -38 jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java
Index: WebdavServlet.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- WebdavServlet.java 2001/03/26 07:10:22 1.10
+++ WebdavServlet.java 2001/04/09 14:41:27 1.11
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v 1.10 2001/03/26 07:10:22 remm Exp $
- * $Revision: 1.10 $
- * $Date: 2001/03/26 07:10:22 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v 1.11 2001/04/09 14:41:27 juergen Exp $
+ * $Revision: 1.11 $
+ * $Date: 2001/04/09 14:41:27 $
*
* ====================================================================
*
@@ -190,7 +190,7 @@
long startTime = System.currentTimeMillis();
-
+
// if logging for the request/response is required initialise the facades
if (Domain.isEnabled("org.apache.slide.webdav.WebdavServlet.requestResponseLogger", Logger.DEBUG)) {
@@ -219,27 +219,27 @@
// if logging for the request/response is required perform the logging
if (Domain.isEnabled
- ("org.apache.slide.webdav.WebdavServlet.requestResponseLogger",
- Logger.DEBUG)) {
+ ("org.apache.slide.webdav.WebdavServlet.requestResponseLogger",
+ Logger.DEBUG)) {
XMLTestCaseGenerator xmlGen = new XMLTestCaseGenerator
((XHttpServletRequestFacade)req,
- (XHttpServletResponseFacade)resp);
+ (XHttpServletResponseFacade)resp);
xmlGen.setThreadName(Thread.currentThread().getName());
Domain.log
- (xmlGen.toString(),
+ (xmlGen.toString(),
"org.apache.slide.webdav.WebdavServlet.requestResponseLogger",
Logger.DEBUG);
}
Domain.info
(req.getMethod()
- + ( (resp instanceof XHttpServletResponseFacade)
- ? (" = " + ((XHttpServletResponseFacade)resp).getStatus()
- + " " + (WebdavStatus.getStatusText
- (((XHttpServletResponseFacade)resp).getStatus())))
- : ("") )
- + " (time: " + (System.currentTimeMillis() - startTime) + " ms)"
- + " URI = " + WebdavMethod.getRelativePath(req));
+ + ( (resp instanceof XHttpServletResponseFacade)
+ ? (" = " + ((XHttpServletResponseFacade)resp).getStatus()
+ + " " + (WebdavStatus.getStatusText
+ (((XHttpServletResponseFacade)resp).getStatus())))
+ : ("") )
+ + " (time: " + (System.currentTimeMillis() - startTime) + " ms)"
+ + " URI = " + WebdavMethod.getRelativePath(req));
}
@@ -279,32 +279,16 @@
WebdavMethod.init(managerServletPath);
- if (!Domain.isInitialized()) {
+ try {
- try {
-
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setNamespaceAware(false);
- factory.setValidating(false);
- SAXParser parser = factory.newSAXParser();
-
- InputStream is =
- getServletContext().getResourceAsStream(domainConfigFile);
- if (is == null)
- throw new ServletException("Can't find init file");
- Populate pop = new Populate();
- Configuration slideConfiguration =
- new ConfigurationElement(pop.load(new InputSource(is),
- parser.getParser()));
-
- Domain.init(slideConfiguration);
-
- } catch (Throwable t) {
- t.printStackTrace();
- throw new ServletException(t.getMessage());
- }
+ Domain.init(getServletContext().getResource(domainConfigFile).getFile());
+ } catch (Throwable t) {
+ t.printStackTrace();
+ throw new ServletException(t.getMessage());
}
+
+
token = Domain.accessNamespace(new SecurityToken(this), namespaceName);