Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: MODIFIED: util ...

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: MODIFIED: util ...

Author dlr
Full name Daniel Rall
Date 2001-05-14 13:35:33 PDT
Message User: dlr
  Date: 01/05/14 13:35:33

  Modified: java/org/joist/util URL.java
  Log:
  Added non WebMacro-specific overloads for schemeAndServer() and
  httpAndServer() class methods.
  
  Revision Changes Path
  1.40 +26 -10 joist/java/org/joist​/util/URL.java
  
  http://joist.tigris.​org/source/browse/jo​ist/java/org/joist/u​til/URL.java.diff?r1​=1.39&r2=1.40
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: URL.java
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/joist/java/org/jo​ist/util/URL.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -b -r1.39 -r1.40
  --- URL.java 2001/05/05 00:21:55 1.39
  +++ URL.java 2001/05/14 20:35:33 1.40
  @@ -65,7 +65,7 @@
    *
    * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
    * @author <a href="mailto:dlr@col​lab.net">Daniel Rall</a>
  - * @version $Id: URL.java,v 1.39 2001/05/05 00:21:55 ms Exp $
  + * @version $Id: URL.java,v 1.40 2001/05/14 20:35:33 dlr Exp $
    *
    * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999-2001 CollabNet, Inc.
  @@ -155,35 +155,51 @@
       /**
        * @see #protoAndServer()
        */
  - public static StringBuffer httpAndServer (WebContext context)
  + public static final StringBuffer httpAndServer (WebContext context)
       {
  - return protoAndServer(context, HTTP_PROTOCOL);
  + return protoAndServer(conte​xt.getRequest(), HTTP_PROTOCOL);
       }
   
       /**
        * @see #protoAndServer()
        */
  - public static StringBuffer schemeAndServer (WebContext context)
  + public static final StringBuffer schemeAndServer (WebContext context)
       {
  - return protoAndServer(context, context.getRequest()​.getScheme());
  + HttpServletRequest req = context.getRequest();
  + return protoAndServer(req, req.getScheme());
       }
   
       /**
  + * @see #protoAndServer()
  + */
  + public static final StringBuffer httpAndServer (HttpServletRequest req)
  + {
  + return protoAndServer(req, HTTP_PROTOCOL);
  + }
  +
  + /**
  + * @see #protoAndServer()
  + */
  + public static final StringBuffer schemeAndServer (HttpServletRequest req)
  + {
  + return protoAndServer(req, req.getScheme());
  + }
  +
  + /**
        * Generates the leading part of the URL, up through the server.
        *
  - * @param context The WebContext.
  + * @param req The HTTP request.
        * @param protocol The protocol to prepend.
        * @return A StringBuffer with the protocol and server.
        *
        * @exception HandlerException
        */
  - protected static StringBuffer protoAndServer (WebContext context,
  + protected static StringBuffer protoAndServer (HttpServletRequest req,
                                                     String protocol)
       {
           StringBuffer newURL = new StringBuffer(protoco​l).append("://");
  - HttpServletRequest request = context.getRequest();
  - newURL.append(reques​t.getServerName());
  - int p = request.getServerPort();
  + newURL.append(req.ge​tServerName());
  + int p = req.getServerPort();
           if (p != HTTP_PORT && p != HTTPS_PORT)
           {
               newURL.append(':').append(p);
  
  
  

--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@jois​t.tigris.org
For additional commands, e-mail: cvs-help at joist dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: MODIFIED: util ... dlr Daniel Rall 2001-05-14 13:35:33 PDT
Messages per page: