Class AllowedResourceAliasChecker

    • Field Detail

      • FOLLOW_LINKS

        protected static final java.nio.file.LinkOption[] FOLLOW_LINKS
      • NO_FOLLOW_LINKS

        protected static final java.nio.file.LinkOption[] NO_FOLLOW_LINKS
      • _base

        protected java.nio.file.Path _base
    • Constructor Detail

      • AllowedResourceAliasChecker

        public AllowedResourceAliasChecker​(ContextHandler contextHandler)
        Parameters:
        contextHandler - the context handler to use.
    • Method Detail

      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to start the lifecycle
        Overrides:
        doStart in class AbstractLifeCycle
        Throws:
        AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
        java.lang.Exception - If there was a problem starting. Will cause a transition to FAILED state
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Description copied from class: AbstractLifeCycle
        Method to override to stop the lifecycle
        Overrides:
        doStop in class AbstractLifeCycle
        Throws:
        java.lang.Exception - If there was a problem stopping. Will cause a transition to FAILED state
      • check

        public boolean check​(java.lang.String pathInContext,
                             Resource resource)
        Description copied from interface: ContextHandler.AliasCheck
        Check an alias
        Specified by:
        check in interface ContextHandler.AliasCheck
        Parameters:
        pathInContext - The path the aliased resource was created for
        resource - The aliased resourced
        Returns:
        True if the resource is OK to be served.
      • check

        protected boolean check​(java.lang.String pathInContext,
                                java.nio.file.Path path)
      • isAllowed

        protected boolean isAllowed​(java.nio.file.Path path)
      • isSameFile

        protected boolean isSameFile​(java.nio.file.Path path1,
                                     java.nio.file.Path path2)
      • getPath

        protected java.nio.file.Path getPath​(Resource resource)