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

      • initialize

        protected void initialize()
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Overrides:
        doStart in class AbstractLifeCycle
        Throws:
        java.lang.Exception
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Overrides:
        doStop in class AbstractLifeCycle
        Throws:
        java.lang.Exception
      • 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)