Package thredds.server.config
Class TdsContext
- java.lang.Object
-
- thredds.server.config.TdsContext
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.web.context.ServletContextAware
@Component("TdsContext") public final class TdsContext extends Object implements org.springframework.web.context.ServletContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBeanTDScontext implements ServletContextAware so it gets a ServletContext and performs most initial THREDDS set up: - checks version - check for latest stable and development release versions - sets the content directory - reads persistent user defined params and runs ThreddsConfig.init - creates, if don't exist, log and public dirs in content directory - Get default and jsp dispatchers from servletContext - Creates and initializes the TdsConfigMapper - check for debug flags to enableLOOK would be nice to make Immutable
- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description TdsContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()voiddestroy()StringgetConfigFileProperty()FilegetContentRootDir()StringgetContentRootPathProperty()StringgetContextPath()Return the context path under which this web app is running (e.g., "/thredds").javax.servlet.RequestDispatchergetDefaultRequestDispatcher()FilegetDownloadDir()Deprecated.no longer support tds.download.dir propertyFilegetDownloadForm()Deprecated.no longer support tds.download.form propertyFilegetPropertyDir(String prop, String key, boolean create)Deprecated.no longer need this helper functionFilegetPropertyFile(String prop, String key, boolean writeable)Deprecated.no longer need this helper functionFileSourcegetPublicContentDirSource()javax.servlet.ServletContextgetServletContext()FilegetServletRootDirectory()Return the web apps root directory (i.e., getRealPath( "/")).StringgetTdsDebugFlags()StringgetTdsVersionBuildDate()FilegetThreddsDirectory()Return File for content directory (exists() may be false).FilegetTomcatLogDirectory()FilegetUploadDir()Deprecated.no longer support tds.upload.dir propertyFilegetUploadForm()Deprecated.no longer support tds.upload.form propertyStringgetVersionInfo()StringgetWebappDisplayName()StringgetWebappVersion()Return the full version string (. . . )* voidsetContentRootPathProperty(String contentRootPathProperty)voidsetDownloadDirProperty(String downloadDirProperty)Deprecated.no longer support tds.download.dir propertyvoidsetDownloadFormProperty(String downloadFormProperty)Deprecated.no longer support tds.download.form propertyvoidsetServletContext(javax.servlet.ServletContext servletContext)voidsetUploadDirProperty(String uploadDirProperty)Deprecated.no longer support tds.upload.dir propertyvoidsetUploadFormProperty(String uploadFormProperty)Deprecated.no longer support tds.upload.form propertyStringtoString()
-
-
-
Method Detail
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
- Specified by:
setServletContextin interfaceorg.springframework.web.context.ServletContextAware
-
getServletContext
public javax.servlet.ServletContext getServletContext()
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
getContextPath
public String getContextPath()
Return the context path under which this web app is running (e.g., "/thredds").- Returns:
- the context path.
-
getWebappVersion
public String getWebappVersion()
Return the full version string (. . . )* - Returns:
- the full version string.
-
getTdsVersionBuildDate
public String getTdsVersionBuildDate()
-
getVersionInfo
public String getVersionInfo()
-
getWebappDisplayName
public String getWebappDisplayName()
- Returns:
- the name of the webapp as given by the display-name element in web.xml.
-
getServletRootDirectory
public File getServletRootDirectory()
Return the web apps root directory (i.e., getRealPath( "/")). Typically {tomcat}/webapps/thredds- Returns:
- the root directory for the web app.
-
getTomcatLogDirectory
public File getTomcatLogDirectory()
-
getThreddsDirectory
public File getThreddsDirectory()
Return File for content directory (exists() may be false).- Returns:
- a File to the content directory.
-
getContentRootDir
public File getContentRootDir()
-
getPublicContentDirSource
public FileSource getPublicContentDirSource()
-
getDefaultRequestDispatcher
public javax.servlet.RequestDispatcher getDefaultRequestDispatcher()
-
getContentRootPathProperty
public String getContentRootPathProperty()
-
getConfigFileProperty
public String getConfigFileProperty()
-
getUploadDir
@Deprecated public File getUploadDir()
Deprecated.no longer support tds.upload.dir property
-
getDownloadDir
@Deprecated public File getDownloadDir()
Deprecated.no longer support tds.download.dir property
-
getUploadForm
@Deprecated public File getUploadForm()
Deprecated.no longer support tds.upload.form property
-
getDownloadForm
@Deprecated public File getDownloadForm()
Deprecated.no longer support tds.download.form property
-
getTdsDebugFlags
public String getTdsDebugFlags()
-
setContentRootPathProperty
public void setContentRootPathProperty(String contentRootPathProperty)
-
setUploadDirProperty
@Deprecated public void setUploadDirProperty(String uploadDirProperty)
Deprecated.no longer support tds.upload.dir property
-
setDownloadDirProperty
@Deprecated public void setDownloadDirProperty(String downloadDirProperty)
Deprecated.no longer support tds.download.dir property
-
setUploadFormProperty
@Deprecated public void setUploadFormProperty(String uploadFormProperty)
Deprecated.no longer support tds.upload.form property
-
setDownloadFormProperty
@Deprecated public void setDownloadFormProperty(String downloadFormProperty)
Deprecated.no longer support tds.download.form property
-
getPropertyDir
@Deprecated public File getPropertyDir(String prop, String key, boolean create)
Deprecated.no longer need this helper function
-
getPropertyFile
@Deprecated public File getPropertyFile(String prop, String key, boolean writeable)
Deprecated.no longer need this helper function
-
-