Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/util URL.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/util URL.java

Author dlr
Full name Daniel Rall
Date 2001-04-02 15:05:59 PDT
Message User: dlr
  Date: 01/04/02 15:05:59

  Modified: java/org/joist/util URL.java
  Log:
  Cleaned up getProtocol() class method.
  
  Revision Changes Path
  1.35 +17 -13 joist/java/org/joist​/util/URL.java
  
  Index: URL.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/util/URL.java,​v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- URL.java 2001/04/02 21:59:58 1.34
  +++ URL.java 2001/04/02 22:05:59 1.35
  @@ -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.34 2001/04/02 21:59:58 dlr Exp $
  + * @version $Id: URL.java,v 1.35 2001/04/02 22:05:59 dlr Exp $
    *
    * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999-2001 CollabNet, Inc.
  @@ -316,28 +316,32 @@
       public String getProtocol( String inProtocol )
           throws NullPointerException, IllegalArgumentException
       {
  - String protocol = DEFAULT_PROTOCOL; // Protocol to return.
  + String protocol = DEFAULT_PROTOCOL;
   
  - String forceProtocol = JoistProperties.getInstance().
  - getProperty(FORCE_SCHEME_KEY);
  - if( inProtocol != null ) {
  + String forceProtocol = JoistProperties.getP​roperty(FORCE_SCHEME​_KEY);
  + if (inProtocol != null)
  + {
               protocol = inProtocol;
  - } else if (forceProtocol != null) {
  + }
  + else if (forceProtocol != null)
  + {
               if (forceProtocol.equal​sIgnoreCase(HTTP_PRO​TOCOL))
                   protocol = HTTP_PROTOCOL;
               else if (forceProtocol.equal​sIgnoreCase(HTTPS_PR​OTOCOL))
                   protocol = HTTPS_PROTOCOL;
  - } else if ( inProtocol == null) {
  + }
  + else if (inProtocol == null)
  + {
               protocol = HTTP_PROTOCOL;
           }
  -
  - if( !protocol.equalsIgnoreCase( HTTP_PROTOCOL )
  - && !protocol.equalsIgnoreCase( HTTPS_PROTOCOL ) )
  +
  + if ( !protocol.equalsIgno​reCase(HTTP_PROTOCOL​)
  + && !protocol.equalsIgno​reCase(HTTPS_PROTOCO​L) )
           {
  - throw new IllegalArgumentException( "Unsupported protocol: "
  - + inProtocol );
  + throw new IllegalArgumentExcep​tion("Unsupported protocol: "
  + + inProtocol);
           }
  -
  +
           return protocol;
       }

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

Messages

Show all messages in topic

CVS update: joist/java/org/joist/util URL.java dlr Daniel Rall 2001-04-02 15:05:59 PDT
Messages per page: