Class URIEncoder

  extended byorg.apache.jetspeed.util.URIEncoder

public class URIEncoder
extends java.lang.Object

Take a URI and encode it so that it can be stored on all filesystems and HTTP values

$Id:,v 1.11 2004/02/23 03:23:42 jford Exp $
Kevin A. Burton, Santiago Gala

Field Summary
static java.lang.String[] CODED_CHARACTERS
static java.lang.String[] INVALID_CHARACTERS
          A list of invalid characters that can't exist within filenames.
Constructor Summary
Method Summary
static java.lang.String decode(java.lang.String uri)
          Decode the given URI.
static java.lang.String encode(java.lang.String uri)
          Encode the given URI
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final java.lang.String[] INVALID_CHARACTERS
A list of invalid characters that can't exist within filenames. If they appear then the DiskCache will escape them. The current list is in part based on Microsoft Knowledge Base article Q177506 (because DOS filesystems are more generally limited than UNIX filesystems). SGP: Windows NT refuses to take "?", so I add it to the list. Additionally, if we encode "?", the jdk runtime logic decodes it twice for "file:" urls, giving a filename with a space in it. I have fixed it in, avoiding the creation of a new URL when getFile() is not null.


public static final java.lang.String[] CODED_CHARACTERS
Constructor Detail


public URIEncoder()
Method Detail


public static java.lang.String encode(java.lang.String uri)
Encode the given URI


public static java.lang.String decode(java.lang.String uri)
Decode the given URI.

Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.