You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2002/02/28 15:19:12 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/util NetUtils.java

vgritsenko    02/02/28 06:19:12

  Modified:    src/java/org/apache/cocoon/util NetUtils.java
  Log:
  Make it compile under jdk1.2
  
  Revision  Changes    Path
  1.6       +9 -3      xml-cocoon2/src/java/org/apache/cocoon/util/NetUtils.java
  
  Index: NetUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/util/NetUtils.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NetUtils.java	22 Feb 2002 07:03:57 -0000	1.5
  +++ NetUtils.java	28 Feb 2002 14:19:12 -0000	1.6
  @@ -63,7 +63,7 @@
    * utility methods
    *
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Id: NetUtils.java,v 1.5 2002/02/22 07:03:57 cziegeler Exp $
  + * @version CVS $Id: NetUtils.java,v 1.6 2002/02/28 14:19:12 vgritsenko Exp $
    */
   
   public class NetUtils {
  @@ -124,7 +124,13 @@
        * @return the decoded path
        */
       public static String decodePath(String path) {
  -        return java.net.URLDecoder.decode( path );
  +        // VG: JDK1.2 MEthods throws an exception; JDK1.3 - not.
  +        // http://java.sun.com/products/jdk/1.2/docs/api/java/net/URLDecoder.html#decode(java.lang.String)
  +        try {
  +            return java.net.URLDecoder.decode( path );
  +        } catch (Exception e) {
  +            return path;
  +        }
       }
   
       /**
  @@ -204,7 +210,7 @@
       * Remove path and file information from a filename returning only its
       * extension  component
       *
  -    * @param filename The filename
  +    * @param uri The filename
       * @return The filename extension (with starting dot!)
       */
       public static String getExtension(String uri) {
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org