Class AllowSymLinkAliasChecker

  • All Implemented Interfaces:
    ContextHandler.AliasCheck

    public class AllowSymLinkAliasChecker
    extends java.lang.Object
    implements ContextHandler.AliasCheck
    Symbolic Link AliasChecker.

    An instance of this class can be registered with ContextHandler.addAliasCheck(AliasCheck) to check resources that are aliased to other locations. The checker uses the Java Files.readSymbolicLink(Path) and Path.toRealPath(java.nio.file.LinkOption...) APIs to check if a file is aliased with symbolic links.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static Logger LOG  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean check​(java.lang.String uri, Resource resource)
      Check an alias
      private boolean hasSymbolicLink​(java.nio.file.Path path)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final Logger LOG
    • Constructor Detail

      • AllowSymLinkAliasChecker

        public AllowSymLinkAliasChecker()
    • Method Detail

      • check

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

        private boolean hasSymbolicLink​(java.nio.file.Path path)