Class SameFileAliasChecker

  • All Implemented Interfaces:
    ContextHandler.AliasCheck

    public class SameFileAliasChecker
    extends java.lang.Object
    implements ContextHandler.AliasCheck
    Alias checking for working with FileSystems that normalize access to the File System.

    The Java Files.isSameFile(Path, Path) method is used to determine if the requested file is the same as the alias file.

    For File Systems that are case insensitive (eg: Microsoft Windows FAT32 and NTFS), the access to the file can be in any combination or style of upper and lowercase.

    For File Systems that normalize UTF-8 access (eg: Mac OSX on HFS+ or APFS, or Linux on XFS) the the actual file could be stored using UTF-16, but be accessed using NFD UTF-8 or NFC UTF-8 for the same file.

    • Method Summary

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

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

      • SameFileAliasChecker

        public SameFileAliasChecker()
    • 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.