com.xpn.xwiki.web
Class Utils

java.lang.Object
  extended bycom.xpn.xwiki.web.Utils

public class Utils
extends java.lang.Object


Constructor Summary
Utils()
           
 
Method Summary
private static byte convertHexDigit(byte b)
          Convert a byte character value to hexidecimal digit value.
static java.lang.String formEncode(java.lang.String value)
           
static byte[] getContent(java.util.List filelist, java.lang.String name)
           
static java.lang.String getFileName(java.util.List filelist, java.lang.String name)
           
static java.lang.String getPage(XWikiRequest request, java.lang.String defaultpage)
           
static java.lang.String getRedirect(java.lang.String action, XWikiContext context)
           
static java.lang.String getRedirect(XWikiRequest request, java.lang.String defaultRedirect)
           
static java.util.Map parseParameters(byte[] data, java.lang.String encoding)
          Append request parameters from the specified String to the specified Map.
static java.util.Map parseParameters(java.lang.String data, java.lang.String encoding)
          Append request parameters from the specified String to the specified Map.
static void parseTemplate(java.lang.String template, boolean write, XWikiContext context)
           
static void parseTemplate(java.lang.String template, XWikiContext context)
           
static XWikiContext prepareContext(java.lang.String action, XWikiRequest request, XWikiResponse response, XWikiEngineContext engine_context)
           
private static void putMapEntry(java.util.Map map, java.lang.String name, java.lang.String value)
          Put name value pair in map.
static java.lang.String SQLFilter(java.lang.String text)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

parseTemplate

public static void parseTemplate(java.lang.String template,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

parseTemplate

public static void parseTemplate(java.lang.String template,
                                 boolean write,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

getRedirect

public static java.lang.String getRedirect(XWikiRequest request,
                                           java.lang.String defaultRedirect)

getRedirect

public static java.lang.String getRedirect(java.lang.String action,
                                           XWikiContext context)

getPage

public static java.lang.String getPage(XWikiRequest request,
                                       java.lang.String defaultpage)

getFileName

public static java.lang.String getFileName(java.util.List filelist,
                                           java.lang.String name)

getContent

public static byte[] getContent(java.util.List filelist,
                                java.lang.String name)
                         throws XWikiException
Throws:
XWikiException

prepareContext

public static XWikiContext prepareContext(java.lang.String action,
                                          XWikiRequest request,
                                          XWikiResponse response,
                                          XWikiEngineContext engine_context)
                                   throws XWikiException
Throws:
XWikiException

parseParameters

public static java.util.Map parseParameters(java.lang.String data,
                                            java.lang.String encoding)
                                     throws java.io.UnsupportedEncodingException
Append request parameters from the specified String to the specified Map. It is presumed that the specified Map is not accessed from any other thread, so no synchronization is performed.

IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter.

Parameters:
data - Input string containing request parameters
Throws:
java.lang.IllegalArgumentException - if the data is malformed Code borrowed from Apache Tomcat 5.0
java.io.UnsupportedEncodingException

parseParameters

public static java.util.Map parseParameters(byte[] data,
                                            java.lang.String encoding)
                                     throws java.io.UnsupportedEncodingException
Append request parameters from the specified String to the specified Map. It is presumed that the specified Map is not accessed from any other thread, so no synchronization is performed.

IMPLEMENTATION NOTE: URL decoding is performed individually on the parsed name and value elements, rather than on the entire query string ahead of time, to properly deal with the case where the name or value includes an encoded "=" or "&" character that would otherwise be interpreted as a delimiter. NOTE: byte array data is modified by this method. Caller beware.

Parameters:
data - Input string containing request parameters
encoding - Encoding to use for converting hex
Throws:
java.io.UnsupportedEncodingException - if the data is malformed Code borrowed from Apache Tomcat 5.0

convertHexDigit

private static byte convertHexDigit(byte b)
Convert a byte character value to hexidecimal digit value.

Parameters:
b - the character value byte Code borrowed from Apache Tomcat 5.0

putMapEntry

private static void putMapEntry(java.util.Map map,
                                java.lang.String name,
                                java.lang.String value)
Put name value pair in map. Put name and value pair in map. When name already exist, add value to array of values. Code borrowed from Apache Tomcat 5.0


formEncode

public static java.lang.String formEncode(java.lang.String value)

SQLFilter

public static java.lang.String SQLFilter(java.lang.String text)


Copyright 2003 Ludovic Dubost