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/01/04 13:34:52 UTC
cvs commit: jakarta-slide/src/webdav/server/org/apache/slide/webdav WebdavServlet.java
juergen 01/01/04 04:34:52
Modified: src/webdav/server/org/apache/slide/webdav WebdavServlet.java
Log:
minor change in logging based on a discussion some time ago:
1) all WebDav methods print their timing
2) this logging is under Domain control
Revision Changes Path
1.2 +23 -19 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WebdavServlet.java 2000/11/22 06:20:46 1.1
+++ WebdavServlet.java 2001/01/04 12:34:52 1.2
@@ -1,13 +1,13 @@
/*
- * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v 1.1 2000/11/22 06:20:46 remm Exp $
- * $Revision: 1.1 $
- * $Date: 2000/11/22 06:20:46 $
+ * $Header: /home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v 1.2 2001/01/04 12:34:52 juergen Exp $
+ * $Revision: 1.2 $
+ * $Date: 2001/01/04 12:34:52 $
*
* ====================================================================
*
* 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.webdav;
@@ -83,7 +83,7 @@
/**
* WebDAV Servlet.
- *
+ *
* @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
*/
public class WebdavServlet extends HttpServlet {
@@ -101,7 +101,7 @@
/**
* Date formatter.
*/
- private static final DateFormat formatter =
+ private static final DateFormat formatter =
new SimpleDateFormat(DATE_FORMAT);
@@ -179,7 +179,7 @@
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 : "
+ System.out.println("Requested session id : "
+ req.getRequestedSessionId());
System.out.println("Request URI : " + req.getRequestURI());
System.out.println("Context path : " + req.getContextPath());
@@ -211,9 +211,9 @@
/**
* Create Slide Method form the HTTP Method.
- *
- * @return WebdavMethod
- * @exception WebdavException
+ *
+ * @return WebdavMethod
+ * @exception WebdavException
*/
private WebdavMethod createWebdavMethod
(HttpServletRequest req, HttpServletResponse resp)
@@ -267,7 +267,7 @@
throws ServletException, IOException {
//showRequestInfo(req);
-
+ long startTime = System.currentTimeMillis();
resp.setStatus(WebdavStatus.SC_OK);
WebdavMethod method = null;
@@ -284,6 +284,10 @@
// If something goes really wrong ...
e.printStackTrace();
}
+
+ Domain.info(req.getMethod() +
+ " (time: " + (System.currentTimeMillis() - startTime) + " ms)" +
+ " URI = " + WebdavMethod.getRelativePath(req));
}
@@ -332,13 +336,13 @@
factory.setValidating(false);
SAXParser parser = factory.newSAXParser();
- InputStream is =
+ 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),
+ Configuration slideConfiguration =
+ new ConfigurationElement(pop.load(new InputSource(is),
parser.getParser()));
Domain.init(slideConfiguration);