cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util URL.java

2002-06-15 Thread billbarker

billbarker2002/06/15 19:52:02

  Modified:catalina/src/share/org/apache/catalina/util URL.java
  Log:
  Teach URL how to parse userInfo.
  
  This allows URL to parse a string of the form:
  ftp://user:[EMAIL PROTECTED]/
  
  This actually doesn't fix any Tomcat problems (assuming that the string
  
  is correct to start with).
  
  Revision  ChangesPath
  1.3   +11 -7 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java
  
  Index: URL.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- URL.java  5 Sep 2001 17:31:11 -   1.2
  +++ URL.java  16 Jun 2002 02:52:02 -  1.3
  @@ -698,7 +698,11 @@
   start = limit;
   }
   if (authority.length()  0) {
  -int colon = authority.indexOf(':');
  + int at = authority.indexOf('@');
  + if( at = 0 ) {
  + userInfo = authority.substring(0,at);
  + }
  +int colon = authority.indexOf(':',at+1);
   if (colon = 0) {
   try {
   port =
  @@ -706,9 +710,9 @@
   } catch (NumberFormatException e) {
   throw new MalformedURLException(e.toString());
   }
  -host = authority.substring(0, colon);
  +host = authority.substring(at+1, colon);
   } else {
  -host = authority;
  +host = authority.substring(at+1);
   port = -1;
   }
   }
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util URL.java

2002-06-15 Thread billbarker

billbarker2002/06/15 19:54:03

  Modified:catalina/src/share/org/apache/catalina/util URL.java
  Log:
  Someday I'll remember to remove tabs before committing.
  
  Revision  ChangesPath
  1.4   +8 -8  
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java
  
  Index: URL.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/URL.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- URL.java  16 Jun 2002 02:52:02 -  1.3
  +++ URL.java  16 Jun 2002 02:54:03 -  1.4
  @@ -698,10 +698,10 @@
   start = limit;
   }
   if (authority.length()  0) {
  - int at = authority.indexOf('@');
  - if( at = 0 ) {
  - userInfo = authority.substring(0,at);
  - }
  +int at = authority.indexOf('@');
  +if( at = 0 ) {
  +userInfo = authority.substring(0,at);
  +}
   int colon = authority.indexOf(':',at+1);
   if (colon = 0) {
   try {
  
  
  

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]