Class TrailingSlashAliasChecker

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.server.TrailingSlashAliasChecker
All Implemented Interfaces:
AliasCheck, org.eclipse.jetty.util.component.LifeCycle

public class TrailingSlashAliasChecker extends org.eclipse.jetty.util.component.AbstractLifeCycle implements AliasCheck

This will approve an alias where the only difference is a trailing slash.

For example, a request for a file containing a trailing slash like /context/dir/index.html/, can be approved as an alias to the file /context/dir/index.html which exists.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkAlias(String pathInContext, org.eclipse.jetty.util.resource.Resource resource)
    Check if an alias is allowed to be served.

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    addEventListener, doStart, doStop, getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, setEventListeners, start, stop, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TrailingSlashAliasChecker

      public TrailingSlashAliasChecker()
  • Method Details

    • checkAlias

      public boolean checkAlias(String pathInContext, org.eclipse.jetty.util.resource.Resource resource)
      Description copied from interface: AliasCheck
      Check if an alias is allowed to be served. If any AliasCheck returns true then the alias will be allowed to be served, therefore any alias checker should take things like the ContextHandler.getProtectedTargets() and Security Constraints into consideration before allowing a return a value of true.
      Specified by:
      checkAlias in interface 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.