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.DisposableBean
TDScontext 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 enable

LOOK would be nice to make Immutable

Since:
4.0
  • Constructor Details

    • TdsContext

      public TdsContext()
  • Method Details

    • setServletContext

      public void setServletContext(jakarta.servlet.ServletContext servletContext)
      Specified by:
      setServletContext in interface org.springframework.web.context.ServletContextAware
    • getServletContext

      public jakarta.servlet.ServletContext getServletContext()
    • destroy

      public void destroy()
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 jakarta.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