Package org.appng.api

Class PathInfo

  • All Implemented Interfaces:
    Path

    public class PathInfo
    extends Object
    implements Path
    Default Path-implementation
    Author:
    Matthias Müller
    • Method Detail

      • hasElementAt

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

        public String getLastElement()
        Description copied from interface: Path
        Returns the last element of this Path.
        Specified by:
        getLastElement in interface Path
        Returns:
        the last element
      • getElementAt

        public String getElementAt​(int idx)
        Description copied from interface: Path
        Returns the element at index idx, if present
        Specified by:
        getElementAt in interface Path
        Parameters:
        idx - the zero-based index
        Returns:
        the element at the given index, or null if no such element exists
      • checkPathLength

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

        public boolean isStaticContent()
        Description copied from interface: Path
        Checks whether this Path represents a static resource from a blob-directory
        Specified by:
        isStaticContent in interface Path
        Returns:
        true if this Path represents a static resource, false otherwise
        See Also:
        Path.getBlobDirectories()
      • isDocument

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

        public boolean isGui()
        Description copied from interface: Path
        Checks whether this Path represents a call to the appNG webapplication GUI
        Specified by:
        isGui in interface Path
        Returns:
        true if this Path represents a call to the appNG webapplication GUI, false otherwise
        See Also:
        Path.getGuiPath()
      • isJsp

        public boolean isJsp()
        Description copied from interface: Path
        Checks whether this Path represents the call of a JSP file.
        Specified by:
        isJsp in interface Path
        Returns:
        true if this Path represents the call of a JSP file, false otherwise
        See Also:
        Path.getExtension(), Path.isDocument()
      • getSiteName

        public String getSiteName()
        Description copied from interface: Path
        Returns the name of the Site which is being addressed by this Path
        Specified by:
        getSiteName in interface Path
        Returns:
        the site name, if present
        See Also:
        Path.hasSite()
      • hasSite

        public boolean hasSite()
        Description copied from interface: Path
        Checks whether this Path contains an element determining the current Site
        Specified by:
        hasSite in interface Path
        Returns:
        true if this Path contains an element determining the current Site, false otherwise
      • setApplicationName

        public void setApplicationName​(String application)
        Manually sets the name of the selected Application
        Parameters:
        application - the name of the Application
      • hasApplication

        public boolean hasApplication()
        Description copied from interface: Path
        Checks whether this Path contains an element determining the current Application
        Specified by:
        hasApplication in interface Path
        Returns:
        true if this Path contains an element determining the current Application, false otherwise
      • setPage

        public void setPage​(String page)
        Manually sets the page within a Application
        Parameters:
        page - the page to set
      • getPage

        public String getPage()
        Description copied from interface: Path
        Returns the name of the currently selected page, if present
        Specified by:
        getPage in interface Path
        Returns:
        the name of the page, or null if no page is selected
        See Also:
        Path.isGui()
      • setAction

        public void setAction​(String actionName,
                              String actionValue)
        Manually sets the name and value for an action within a Application
        Parameters:
        actionName - the name of the action
        actionValue - the value for the action
      • getActionName

        public String getActionName()
        Description copied from interface: Path
        Returns the name of the currently selected action, if present
        Specified by:
        getActionName in interface Path
        Returns:
        the name of the currently selected action, or null if no action is selected
        See Also:
        Path.isGui(), Path.getActionValue()
      • getActionValue

        public String getActionValue()
        Description copied from interface: Path
        Returns the value of the currently selected action, if present
        Specified by:
        getActionValue in interface Path
        Returns:
        the value of the currently selected action, or null if no action is selected
        See Also:
        Path.isGui(), Path.getActionName()
      • getJspUrlParameters

        public List<String> getJspUrlParameters()
        Description copied from interface: Path
        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".
        Specified by:
        getJspUrlParameters in interface Path
        Returns:
        a List of parameter values
        See Also:
        Path.isJsp()
      • getRootPath

        public String getRootPath()
        Description copied from interface: Path
        Returns the root-path of this Path, which is the first element, or / if there is no first element
        Specified by:
        getRootPath in interface Path
        Returns:
        the root-path
      • getServletPath

        public String getServletPath()
        Description copied from interface: Path
        Returns the complete servlet-path this Path was built from
        Specified by:
        getServletPath in interface Path
        Returns:
        the servlet-path
      • getCurrentPath

        public String getCurrentPath()
        Description copied from interface: Path
        Returns the current path to the application, e.g. /manager/mysite/myapp
        Specified by:
        getCurrentPath in interface Path
        Returns:
        the current path to the application
      • isRoot

        public boolean isRoot()
        Description copied from interface: Path
        Checks whether this Path represents the root-path
        Specified by:
        isRoot in interface Path
        Returns:
        true if this Path represents the root-path, false otherwise
        See Also:
        Path.getRootPath()
      • isRootIgnoreTrailingSlash

        public boolean isRootIgnoreTrailingSlash()
      • isRepository

        public boolean isRepository()
        Description copied from interface: Path
        Checks whether this Path represents the repository-folder of appNG
        Specified by:
        isRepository in interface Path
        Returns:
        true if this Path represents the repository-folder of appNG, false otherwise
      • isMonitoring

        public boolean isMonitoring()
        Description copied from interface: Path
        Checks whether this Path represents a monitoring path
        Specified by:
        isMonitoring in interface Path
        Returns:
        true if this Path represents a monitoring path, false otherwise
      • getGuiPath

        public String getGuiPath()
        Description copied from interface: Path
        Returns the path to the appNG webapplication.
        Specified by:
        getGuiPath in interface Path
        Returns:
        the path to the appNG webapplication
        See Also:
        Path.isGui()
      • getBlobDirectories

        public List<String> getBlobDirectories()
        Description copied from interface: Path
        Returns a List of all directories which are being used to store BLOBs
        Specified by:
        getBlobDirectories in interface Path
        Returns:
        a List of all blob directories
      • isPathSelected

        public boolean isPathSelected​(String path)
        Description copied from interface: Path
        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.
        Specified by:
        isPathSelected in interface Path
        Parameters:
        path - the servlet-path to check
        Returns:
        true if this Path , false otherwise
        See Also:
        Path.getServletPath()
      • getExtension

        public String getExtension()
        Description copied from interface: Path
        Returns the file-extension for JSP-files
        Specified by:
        getExtension in interface Path
        Returns:
        the file-extension
        See Also:
        Path.isJsp()
      • getForwardPath

        public String getForwardPath​(String wwwRootPath,
                                     File wwwRootFile)
        Builds the the path to which a HttpServletRequest has to be forwarded to in order the retrieve a file from a document directory. If the requested fiel is a JSP, the JSP Url-Parameters are being initialized.
        Parameters:
        wwwRootPath - the relative path to a Sites web-folder, under which the document-folders reside
        wwwRootFile - a file representing the very same relative path
        Returns:
        the forward path
        See Also:
        isDocument(), getDocumentDirectories(), isJsp()
      • getElementCount

        public int getElementCount()
        Description copied from interface: Path
        Returns the number of elements of this Path
        Specified by:
        getElementCount in interface Path
        Returns:
        the number of elements