com.sun.grizzly.util.http.mapper
Class AlternateDocBase

java.lang.Object
  extended by com.sun.grizzly.util.http.mapper.AlternateDocBase

public class AlternateDocBase
extends Object


Constructor Summary
AlternateDocBase()
           
 
Method Summary
static AlternateDocBase findMatch(String path, List<AlternateDocBase> alternateDocBases)
          Attempts to match the given request path against one of the given alternate doc bases.
 String getBasePath()
          Gets the absolute doc base path of this AlternateDocBase.
 String getDocBase()
          Gets the (possibly relative) doc base path of this AlternateDocBase.
 DirContext getResources()
          Gets the proxied resources of this AlternateDocBase.
 String getUrlPattern()
          Gets the url pattern of this AlternateDocBase.
 int getUrlPatternSlashCount()
          Gets the number of slashes in the url pattern of this AlternateDocBase.
 String getUrlPatternSuffix()
          Gets the extension suffix of the url pattern of this AlternateDocBase.
 com.sun.grizzly.util.http.mapper.AlternateDocBase.UrlPatternType getUrlPatternType()
          Gets the url pattern type (exact, wildcard, extension) of this AlternateDocBase.
 String getUrlPatternWildcardPath()
          Gets the wildcard path of this AlternateDocBase (this is the path specified by the wildcard pattern, minus the trailing '*').
 DirContext getWebappResources()
          Gets the non-proxied resources of this AlternateDocBase.
 void setBasePath(String basePath)
          Sets the absolute doc base path of this AlternateDocBase.
 void setDocBase(String docBase)
          Sets the (possibly relative) doc base path of this AlternateDocBase.
 void setResources(DirContext resources)
          Sets the proxied resources of this AlternateDocBase.
 void setUrlPattern(String urlPattern)
          Sets the url pattern of this AlternateDocBase.
 void setWebappResources(DirContext webappResources)
          Sets the non-proxied resources of this AlternateDocBase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlternateDocBase

public AlternateDocBase()
Method Detail

setUrlPattern

public void setUrlPattern(String urlPattern)
Sets the url pattern of this AlternateDocBase.

Parameters:
urlPattern - The url pattern of this AlternateDocBase

getUrlPattern

public String getUrlPattern()
Gets the url pattern of this AlternateDocBase.

Returns:
The url pattern of this AlternativeDocBase

getUrlPatternType

public com.sun.grizzly.util.http.mapper.AlternateDocBase.UrlPatternType getUrlPatternType()
Gets the url pattern type (exact, wildcard, extension) of this AlternateDocBase.

Returns:
The url pattern type (exact, wildcard, extension) of this AlternativeDocBase

getUrlPatternSlashCount

public int getUrlPatternSlashCount()
Gets the number of slashes in the url pattern of this AlternateDocBase.

Returns:
Number of slashes in the url pattern of this AlternateDocBase.

getUrlPatternSuffix

public String getUrlPatternSuffix()
Gets the extension suffix of the url pattern of this AlternateDocBase.

Returns:
The extension suffix of the url pattern of this AlternateDocBase, or null if the url pattern is not of type 'extension'

getUrlPatternWildcardPath

public String getUrlPatternWildcardPath()
Gets the wildcard path of this AlternateDocBase (this is the path specified by the wildcard pattern, minus the trailing '*').

Returns:
The wildcard path of this AlternateDocBase, or null if the pattern associated with this AlternateDocBase is not a wildcard pattern

setDocBase

public void setDocBase(String docBase)
Sets the (possibly relative) doc base path of this AlternateDocBase.

Parameters:
docBase - The (possibly relative) doc base path of this AlternateDocBase

getDocBase

public String getDocBase()
Gets the (possibly relative) doc base path of this AlternateDocBase.

Returns:
The (possibly relative) doc base path of this AlternativeDocBase

setBasePath

public void setBasePath(String basePath)
Sets the absolute doc base path of this AlternateDocBase.

Parameters:
basePath - The absolute doc base path of this AlternateDocBase

getBasePath

public String getBasePath()
Gets the absolute doc base path of this AlternateDocBase.

Returns:
The absolute doc base path of this AlternativeDocBase

setResources

public void setResources(DirContext resources)
Sets the proxied resources of this AlternateDocBase.

Parameters:
resources - The proxied resources of this AlternateDocBase

getResources

public DirContext getResources()
Gets the proxied resources of this AlternateDocBase.

Returns:
The proxied resources of this AlternateDocBase

setWebappResources

public void setWebappResources(DirContext webappResources)
Sets the non-proxied resources of this AlternateDocBase.

Parameters:
webappResources - The non-proxied resources of this AlternateDocBase

getWebappResources

public DirContext getWebappResources()
Gets the non-proxied resources of this AlternateDocBase.

Returns:
The non-proxied resources of this AlternateDocBase

findMatch

public static AlternateDocBase findMatch(String path,
                                         List<AlternateDocBase> alternateDocBases)
Attempts to match the given request path against one of the given alternate doc bases.

Returns:
The alternate doc base whose url pattern matches the given path, or null if no matching alternate doc base could be found


Copyright © 2012 Oracle Corporation. All Rights Reserved.