net.spy.jwebkit
Class ContextUtil

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.jwebkit.ContextUtil

public final class ContextUtil
extends net.spy.SpyObject

Utilities to get configuration parameters from a context.


Constructor Summary
ContextUtil()
           
 
Method Summary
static java.lang.String getRelativeFilePath(javax.servlet.ServletContext ctx, java.lang.String p)
          Get a possibly context relative file path.
static java.lang.String getRelativeFilePathParameter(javax.servlet.ServletContext ctx, java.lang.String name, java.lang.String def)
          Get a context relative file path configuration parameter.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextUtil

public ContextUtil()
Method Detail

getRelativeFilePath

public static java.lang.String getRelativeFilePath(javax.servlet.ServletContext ctx,
                                                   java.lang.String p)
Get a possibly context relative file path. If the path begins with /WEB-INF, locate the path from within the context of the web app, else return the absolute path.

Parameters:
ctx - the servlet context
p - the input path
Returns:
the translated path

getRelativeFilePathParameter

public static java.lang.String getRelativeFilePathParameter(javax.servlet.ServletContext ctx,
                                                            java.lang.String name,
                                                            java.lang.String def)
Get a context relative file path configuration parameter.

Parameters:
name - the name of the config parameter
def - the default value
Returns:
the translated path in either case


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.