Package com.oorian

Interface AppContext

All Known Implementing Classes:
JakartaAppContext, TestAppContext

public interface AppContext
Abstraction layer for servlet context access, decoupling framework code from servlet API specifics.

This interface wraps the subset of servlet context methods used by the Oorian framework, primarily resource loading and context path access.

Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
  • Method Details

    • getContextPath

      String getContextPath()
      Returns the context path of the web application.
      Returns:
      the context path
    • getResourceAsStream

      InputStream getResourceAsStream(String path)
      Returns an input stream for reading the specified resource.
      Parameters:
      path - the resource path (e.g., "/WEB-INF/config.xml")
      Returns:
      an input stream for the resource, or null if not found
    • getRealPath

      String getRealPath(String path)
      Returns the real filesystem path for the specified virtual path.
      Parameters:
      path - the virtual path (e.g., "/WEB-INF/config.xml")
      Returns:
      the real path, or null if the translation cannot be performed
    • getAttribute

      Object getAttribute(String name)
      Returns the value of the named context attribute.
      Parameters:
      name - the attribute name
      Returns:
      the attribute value, or null if not set
    • setAttribute

      void setAttribute(String name, Object value)
      Sets a context attribute.
      Parameters:
      name - the attribute name
      value - the attribute value
    • getInitParameter

      String getInitParameter(String name)
      Returns the value of the named context initialization parameter.
      Parameters:
      name - the parameter name
      Returns:
      the parameter value, or null if not defined
    • getMimeType

      String getMimeType(String file)
      Returns the MIME type of the specified file, or null if unknown.
      Parameters:
      file - the file name
      Returns:
      the MIME type, or null