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 ms
Full name zxcv
Date 2001-05-04 16:34:47 PDT
Message User: ms
  Date: 01/05/04 16:34:47

  Modified: java/org/joist/util URL.java
  Log:
  added method to convert charactrs to base-64 values
  
  Revision Changes Path
  1.38 +29 -1 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.37&r2=1.38
  
  (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.37
  retrieving revision 1.38
  diff -u -b -r1.37 -r1.38
  --- URL.java 2001/04/07 21:40:51 1.37
  +++ URL.java 2001/05/04 23:34:46 1.38
  @@ -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.37 2001/04/07 21:40:51 dlr Exp $
  + * @version $Id: URL.java,v 1.38 2001/05/04 23:34:46 ms Exp $
    *
    * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999-2001 CollabNet, Inc.
  @@ -129,6 +129,10 @@
       private static final boolean DEBUG = true;
   
       /**
  + * Base64 value for space
  + */
  + public static final String URL_SPACE = "%20";
  + /**
        * Tests for inclusion of a protocol in the specified URL. Useful when
        * determining whether or not a URL is local.
        *
  @@ -370,6 +374,30 @@
       if (queryString != null) url.append('?').appe​nd(queryString);
   
           return url.toString();
  + }
  +
  + /**
  + * Converts characters to their %xx equivalent
  + *
  + * @param String to convert
  + * @return String with converted values
  + */
  + public static String encode (String unclean)
  + {
  + StringBuffer clean = new StringBuffer(unclean.length());
  + char[] uncleanChars = unclean.toCharArray();
  + for (int i = 0; i < uncleanChars.length; i++)
  + {
  + switch(uncleanChars[i])
  + {
  + case ' ':
  + clean.append(URL_SPACE);
  + break;
  + default:
  + clean.append(uncleanChars[i]);
  + }
  + }
  + return clean.toString();
       }
   
   }
  
  
  

--------------------​--------------------​--------------------​---------
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 ... ms zxcv 2001-05-04 16:34:47 PDT
Messages per page: