Package org.appng.api

Interface Path

  • All Known Implementing Classes:
    PathInfo

    public interface Path
    A Path provides informations about the Site to which the current HttpServletRequest belongs to. Therefore, the servlet-path returned by HttpServletRequest.getServletPath() is split into path-elements using / as a separator.
    Author:
    Matthias Müller
    • Method Detail

      • hasElementAt

        boolean hasElementAt​(int idx)
        Returns true if this Path has an elements at index idx.
        Parameters:
        idx - the zero-based index to check
        Returns:
        true if there is such a path element,false otherwise
      • getLastElement

        String getLastElement()
        Returns the last element of this Path.
        Returns:
        the last element
      • getElementAt

        String getElementAt​(int idx)
        Returns the element at index idx, if present
        Parameters:
        idx - the zero-based index
        Returns:
        the element at the given index, or null if no such element exists
      • checkPathLength

        void checkPathLength​(int minLength)
                      throws IOException
        Checks whether this Path has the given minimum number of elements and throws an IOException otherwise
        Parameters:
        minLength - the minimum length to check
        Throws:
        IOException - if this Path does not have the required minimum length
      • isStaticContent

        boolean isStaticContent()
        Checks whether this Path represents a static resource from a blob-directory
        Returns:
        true if this Path represents a static resource, false otherwise
        See Also:
        getBlobDirectories()
      • isDocument

        boolean isDocument()
        Checks whether this Path represents a document from a document-folder.
        Returns:
        true if this Path represents a JSP file from a document-folder, false otherwise
        See Also:
        getDocumentDirectories()
      • isGui

        boolean isGui()
        Checks whether this Path represents a call to the appNG webapplication GUI
        Returns:
        true if this Path represents a call to the appNG webapplication GUI, false otherwise
        See Also:
        getGuiPath()
      • isJsp

        boolean isJsp()
        Checks whether this Path represents the call of a JSP file.
        Returns:
        true if this Path represents the call of a JSP file, false otherwise
        See Also:
        getExtension(), isDocument()
      • getSiteName

        String getSiteName()
        Returns the name of the Site which is being addressed by this Path
        Returns:
        the site name, if present
        See Also:
        hasSite()
      • hasSite

        boolean hasSite()
        Checks whether this Path contains an element determining the current Site
        Returns:
        true if this Path contains an element determining the current Site, false otherwise
      • getApplicationName

        String getApplicationName()
        Returns the name of the Application which is being addressed by this Path
        Returns:
        the application name, if present
        See Also:
        hasApplication()
      • hasApplication

        boolean hasApplication()
        Checks whether this Path contains an element determining the current Application
        Returns:
        true if this Path contains an element determining the current Application, false otherwise
      • getPage

        String getPage()
        Returns the name of the currently selected page, if present
        Returns:
        the name of the page, or null if no page is selected
        See Also:
        isGui()
      • getActionName

        String getActionName()
        Returns the name of the currently selected action, if present
        Returns:
        the name of the currently selected action, or null if no action is selected
        See Also:
        isGui(), getActionValue()
      • getActionValue

        String getActionValue()
        Returns the value of the currently selected action, if present
        Returns:
        the value of the currently selected action, or null if no action is selected
        See Also:
        isGui(), getActionName()
      • hasAction

        boolean hasAction()
        Checks whether this Path has an action selected
        Returns:
        true if this Path , false otherwise
        See Also:
        getActionName(), getActionValue()
      • getJspUrlParameters

        List<String> getJspUrlParameters()
        Returns a List containing the values of the JSP-Paramters of a JSP-call. Every parameter after the JSPs name is a JSP-Parameter. For example, if the current servletpath is /en/index/foo/bar, with en being a document folder and index the JSP name, the list will contain "foo" and "bar".
        Returns:
        a List of parameter values
        See Also:
        isJsp()
      • getRootPath

        String getRootPath()
        Returns the root-path of this Path, which is the first element, or / if there is no first element
        Returns:
        the root-path
      • getServletPath

        String getServletPath()
        Returns the complete servlet-path this Path was built from
        Returns:
        the servlet-path
      • getCurrentPath

        String getCurrentPath()
        Returns the current path to the application, e.g. /manager/mysite/myapp
        Returns:
        the current path to the application
      • isRoot

        boolean isRoot()
        Checks whether this Path represents the root-path
        Returns:
        true if this Path represents the root-path, false otherwise
        See Also:
        getRootPath()
      • isRepository

        boolean isRepository()
        Checks whether this Path represents the repository-folder of appNG
        Returns:
        true if this Path represents the repository-folder of appNG, false otherwise
      • isMonitoring

        default boolean isMonitoring()
        Checks whether this Path represents a monitoring path
        Returns:
        true if this Path represents a monitoring path, false otherwise
        Since:
        1.21.0
      • getGuiPath

        String getGuiPath()
        Returns the path to the appNG webapplication.
        Returns:
        the path to the appNG webapplication
        See Also:
        isGui()
      • getBlobDirectories

        List<String> getBlobDirectories()
        Returns a List of all directories which are being used to store BLOBs
        Returns:
        a List of all blob directories
      • getDocumentDirectories

        List<String> getDocumentDirectories()
        Returns a List of all document directories, which contain the JSP-files
        Returns:
        a List of all document directories
        See Also:
        isDocument(), isJsp()
      • getPlatformUrl

        String getPlatformUrl()
        Returns the complete absolute URL this Path represents, which is the Sites domain plus the servlet-path
        Returns:
        the complete URL
        See Also:
        getDomain(), getServletPath()
      • getOutputFormat

        String getOutputFormat()
        Returns the ID of OutputFormat.
        An OutputFormat may be defined by adding _<format> after the gui-path, e.g. /ws/_html/site/application/page.
        Returns:
        the ID of the OutputFormat, if present
        See Also:
        isGui()
      • hasOutputType

        boolean hasOutputType()
        Checks whether this Path has an OutputType set.
        Returns:
        true if this Path has an OutputType set, false otherwise
        See Also:
        getOutputType()
      • getService

        String getService()
        Return the name of the service addressed by this Path
        Returns:
        the name of the service, if present
        See Also:
        isService(), getServicePath()
      • getServicePath

        String getServicePath()
        Returns the path element that addresses a service
        Returns:
        the path element that addresses a service, if present
        See Also:
        isService(), getService()
      • isPathSelected

        boolean isPathSelected​(String servletPath)
        Checks whether the given servletPath is being addressed by this Path, which basically means the servlet-path represented by this Path must start with the given servletPath.
        Parameters:
        servletPath - the servlet-path to check
        Returns:
        true if this Path , false otherwise
        See Also:
        getServletPath()
      • getExtension

        String getExtension()
        Returns the file-extension for JSP-files
        Returns:
        the file-extension
        See Also:
        isJsp()
      • getElementCount

        int getElementCount()
        Returns the number of elements of this Path
        Returns:
        the number of elements