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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `SEPARATOR` The separator for a path

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkPathLength(int minLength)` Checks whether this `Path` has the given minimum number of elements and throws an `IOException` otherwise
    `String` | `getActionName()` Returns the name of the currently selected action, if present
    `String` | `getActionValue()` Returns the value of the currently selected action, if present
    `int` | `getApplicationIndex()` Return the index of the element representing the `Application` name
    `String` | `getApplicationName()` Returns the name of the `Application` which is being addressed by this `Path`
    `List<String>` | `getApplicationUrlParameters()` Returns a `List` containing the values of the `UrlParams` of a `Application`s page or service-call.
    `List<String>` | `getBlobDirectories()` Returns a `List` of all directories which are being used to store BLOBs
    `String` | `getCurrentPath()` Returns the current path to the application, e.g.
    `List<String>` | `getDocumentDirectories()` Returns a `List` of all document directories, which contain the JSP-files
    `String` | `getDomain()` Returns the domain of the currently selected `Site`, if present
    `String` | `getElementAt(int idx)` Returns the element at index `idx`, if present
    `int` | `getElementCount()` Returns the number of elements of this `Path`
    `String` | `getExtension()` Returns the file-extension for JSP-files
    `String` | `getGuiPath()` Returns the path to the appNG webapplication.
    `String` | `getHost()` Returns the host of the currently selected `Site`, if present
    `List<String>` | `getJspUrlParameters()` Returns a `List` containing the values of the JSP-Paramters of a JSP-call.
    `String` | `getLastElement()` Returns the last element of this `Path`.
    `String` | `getOutputFormat()` Returns the ID of `OutputFormat`. An `OutputFormat` may be defined by adding `_<format>` after the gui-path, e.g.
    `String` | `getOutputPrefix()` Returns the path prefix that contains the `OutputFormat` and `OutputType`, if those are set.
    `String` | `getOutputType()` Returns the ID of `OutputType`. An `OutputType` may be defined by adding `_<type>` after the output-format, e.g.
    `String` | `getPage()` Returns the name of the currently selected page, if present
    `String` | `getPlatformUrl()` Returns the complete absolute URL this `Path` represents, which is the `Site`s domain plus the servlet-path
    `String` | `getRootPath()` Returns the root-path of this `Path`, which is the first element, or `/` if there is no first element
    `String` | `getService()` Return the name of the service addressed by this `Path`
    `String` | `getServicePath()` Returns the path element that addresses a service
    `String` | `getServletPath()` Returns the complete servlet-path this `Path` was built from
    `String` | `getSiteName()` Returns the name of the `Site` which is being addressed by this `Path`
    `boolean` | `hasAction()` Checks whether this `Path` has an action selected
    `boolean` | `hasApplication()` Checks whether this `Path` contains an element determining the current `Application`
    `boolean` | `hasElementAt(int idx)` Returns `true` if this `Path` has an elements at index `idx`.
    `boolean` | `hasOutputFormat()` Checks whether this `Path` has an `OutputFormat` set.
    `boolean` | `hasOutputType()` Checks whether this `Path` has an `OutputType` set.
    `boolean` | `hasSite()` Checks whether this `Path` contains an element determining the current `Site`
    `boolean` | `isDocument()` Checks whether this `Path` represents a document from a document-folder.
    `boolean` | `isGui()` Checks whether this `Path` represents a call to the appNG webapplication GUI
    `boolean` | `isJsp()` Checks whether this `Path` represents the call of a JSP file.
    `default boolean` | `isMonitoring()` Checks whether this `Path` represents a monitoring path
    `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`.
    `boolean` | `isRepository()` Checks whether this `Path` represents the repository-folder of appNG
    `boolean` | `isRoot()` Checks whether this `Path` represents the root-path
    `boolean` | `isService()` Checks whether this `Path` represents a call to a service (`Webservice`/`AttachmentWebservice`, `SoapService` or an XML/JSON call of an `ActionProvider` or `DataProvider`.
    `boolean` | `isStaticContent()` Checks whether this `Path` represents a static resource from a blob-directory

- - ### Field Detail

    - #### SEPARATOR

          static final String SEPARATOR

      The separator for a path
      See Also:
        Constant Field Values

  - ### 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()`

    - #### isService

          boolean isService()

      Checks whether this `Path` represents a call to a service (`Webservice`/`AttachmentWebservice`, `SoapService` or an XML/JSON call of an `ActionProvider` or `DataProvider`.
      Returns:
        `true` if this `Path` represents a call to a service, `false` otherwise

    - #### 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()`

    - #### getApplicationUrlParameters

          List<String> getApplicationUrlParameters()

      Returns a `List` containing the values of the `UrlParams` of a `Application`s page or service-call.
      Returns:
        a `List` of parameter values
      See Also:
        `isGui()`, `isService()`

    - #### 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

    - #### getHost

          String getHost()

      Returns the host of the currently selected `Site`, if present
      Returns:
        the host of the `Site`
      See Also:
        `hasSite()`, `Site.getHost()`

    - #### getDomain

          String getDomain()

      Returns the domain of the currently selected `Site`, if present
      Returns:
        the domain of the `Site`
      See Also:
        `hasSite()`, `Site.getDomain()`

    - #### 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 `Site`s 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()`

    - #### getOutputType

          String getOutputType()

      Returns the ID of `OutputType`.
      An `OutputType` may be defined by adding `_<type>` after the output-format, e.g. `/ws/_html/_minimal/site/application/page`.
      Returns:
        the ID of the `OutputType`, if present
      See Also:
        `isGui()`, `getOutputFormat()`

    - #### hasOutputFormat

          boolean hasOutputFormat()

      Checks whether this `Path` has an `OutputFormat` set.
      Returns:
        `true` if this `Path` has an `OutputFormat` set, `false` otherwise
      See Also:
        `getOutputFormat()`

    - #### 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()`

    - #### getOutputPrefix

          String getOutputPrefix()

      Returns the path prefix that contains the `OutputFormat` and `OutputType`, if those are set.
      Returns:
        the path prefix
      See Also:
        `getOutputFormat()`, `getOutputType()`

    - #### getExtension

          String getExtension()

      Returns the file-extension for JSP-files
      Returns:
        the file-extension
      See Also:
        `isJsp()`

    - #### getApplicationIndex

          int getApplicationIndex()

      Return the index of the element representing the `Application` name
      Returns:
        The index of the element representing the `Application` name
      See Also:
        `getApplicationName()`, `hasApplication()`, `getElementAt(int)`

    - #### getElementCount

          int getElementCount()

      Returns the number of elements of this `Path`
      Returns:
        the number of elements

Copyright © 2011–2023 aiticon GmbH. All rights reserved.