info.magnolia.init
Class DefaultMagnoliaInitPaths

java.lang.Object
  extended by info.magnolia.init.DefaultMagnoliaInitPaths
All Implemented Interfaces:
MagnoliaInitPaths

@Singleton
public class DefaultMagnoliaInitPaths
extends Object
implements MagnoliaInitPaths

A simple wrapper about the few initial variables used to resolve PropertySource.

Version:
$Revision: $ ($Author: $)
Author:
gjoseph

Field Summary
protected static String MAGNOLIA_UNQUALIFIED_SERVER_NAME
          Context parameter name.
 
Constructor Summary
DefaultMagnoliaInitPaths(MagnoliaServletContextListener magnoliaServletContextListener, javax.servlet.ServletContext servletContext)
           
 
Method Summary
protected  String determineContextPath(javax.servlet.ServletContext context)
           
protected  String determineRootPath(javax.servlet.ServletContext context)
          Figures out the root path where the webapp is deployed.
protected  String determineServerName(javax.servlet.ServletContext context)
          Figures out the local host name, makes sure it's lowercase, and use its unqualified name if the "magnolia.unqualified.server.name" init parameter is set to true.
protected  String determineWebappFolderName(String determinedRootPath, javax.servlet.ServletContext context)
           
 String getContextPath()
           
 String getRootPath()
           
 String getServerName()
           
 String getWebappFolderName()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAGNOLIA_UNQUALIFIED_SERVER_NAME

protected static final String MAGNOLIA_UNQUALIFIED_SERVER_NAME
Context parameter name. If set to true in web.xml the server name resolved by magnolia will never contain the domain (the server "server.domain.com" will be simply resolved as "server").

See Also:
Constant Field Values
Constructor Detail

DefaultMagnoliaInitPaths

@Inject
public DefaultMagnoliaInitPaths(MagnoliaServletContextListener magnoliaServletContextListener,
                                       javax.servlet.ServletContext servletContext)
Method Detail

determineServerName

protected String determineServerName(javax.servlet.ServletContext context)
Figures out the local host name, makes sure it's lowercase, and use its unqualified name if the "magnolia.unqualified.server.name" init parameter is set to true.


determineRootPath

protected String determineRootPath(javax.servlet.ServletContext context)
Figures out the root path where the webapp is deployed.


determineWebappFolderName

protected String determineWebappFolderName(String determinedRootPath,
                                           javax.servlet.ServletContext context)

determineContextPath

protected String determineContextPath(javax.servlet.ServletContext context)

getServerName

public String getServerName()
Specified by:
getServerName in interface MagnoliaInitPaths

getRootPath

public String getRootPath()
Specified by:
getRootPath in interface MagnoliaInitPaths

getWebappFolderName

public String getWebappFolderName()
Specified by:
getWebappFolderName in interface MagnoliaInitPaths

getContextPath

public String getContextPath()
Specified by:
getContextPath in interface MagnoliaInitPaths


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.