Package: io.vertx.groovy.ext.web.handler

## [Groovy] Class StaticHandler

- io.vertx.groovy.ext.web.handler.StaticHandler

- All Implemented Interfaces and Traits:
    Handler

      @CompileStatic
      class StaticHandler

  A handler for serving static resources from the file system or classpath.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `StaticHandler (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `static StaticHandler` | `create()` Create a handler using defaults
    `static StaticHandler` | `create(String root)` Create a handler, specifying web-root
    `Object` | `getDelegate()`
    `void` | `handle(RoutingContext arg0)`
    `StaticHandler` | `setAlwaysAsyncFS(boolean alwaysAsyncFS)` Set whether async filesystem access should always be used
    `StaticHandler` | `setCacheEntryTimeout(long timeout)` Set the server cache entry timeout when caching is enabled
    `StaticHandler` | `setCachingEnabled(boolean enabled)` Set whether cache header handling is enabled
    `StaticHandler` | `setDirectoryListing(boolean directoryListing)` Set whether directory listing is enabled
    `StaticHandler` | `setDirectoryTemplate(String directoryTemplate)` Set the directory template to be used when directory listing
    `StaticHandler` | `setEnableFSTuning(boolean enableFSTuning)` Set whether async/sync filesystem tuning should enabled
    `StaticHandler` | `setEnableRangeSupport(boolean enableRangeSupport)` Set whether range requests (resumable downloads; media streaming) should be enabled.
    `StaticHandler` | `setFilesReadOnly(boolean readOnly)` Set whether files are read-only and will never change
    `StaticHandler` | `setIncludeHidden(boolean includeHidden)` Set whether hidden files should be served
    `StaticHandler` | `setIndexPage(String indexPage)` Set the index page
    `StaticHandler` | `setMaxAgeSeconds(long maxAgeSeconds)` Set value for max age in caching headers
    `StaticHandler` | `setMaxAvgServeTimeNs(long maxAvgServeTimeNanoSeconds)` Set the max serve time in ns, above which serves are considered slow
    `StaticHandler` | `setMaxCacheSize(int maxCacheSize)` Set the max cache size, when caching is enabled
    `StaticHandler` | `setWebRoot(String webRoot)` Set the web root

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### StaticHandler(Object delegate)

  - ### Method Detail

    - #### static StaticHandler create()

      Create a handler using defaults

      Returns:
        the handler

    - #### static StaticHandler create(String root)

      Create a handler, specifying web-root

      Returns:
        the handler
      Parameters:
        `root` - the web-root

    - #### Object getDelegate()

    - #### void handle(RoutingContext arg0)

    - #### StaticHandler setAlwaysAsyncFS(boolean alwaysAsyncFS)

      Set whether async filesystem access should always be used

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `alwaysAsyncFS` - true for always async FS access

    - #### StaticHandler setCacheEntryTimeout(long timeout)

      Set the server cache entry timeout when caching is enabled

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `timeout` - the timeout, in ms

    - #### StaticHandler setCachingEnabled(boolean enabled)

      Set whether cache header handling is enabled

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `enabled` - true if enabled

    - #### StaticHandler setDirectoryListing(boolean directoryListing)

      Set whether directory listing is enabled

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `directoryListing` - true if enabled

    - #### StaticHandler setDirectoryTemplate(String directoryTemplate)

      Set the directory template to be used when directory listing

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `directoryTemplate` - the directory template

    - #### StaticHandler setEnableFSTuning(boolean enableFSTuning)

      Set whether async/sync filesystem tuning should enabled

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `enableFSTuning` - true to enabled FS tuning

    - #### StaticHandler setEnableRangeSupport(boolean enableRangeSupport)

      Set whether range requests (resumable downloads; media streaming) should be enabled.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `enableRangeSupport` - true to enable range support

    - #### StaticHandler setFilesReadOnly(boolean readOnly)

      Set whether files are read-only and will never change

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `readOnly` - whether files are read-only

    - #### StaticHandler setIncludeHidden(boolean includeHidden)

      Set whether hidden files should be served

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `includeHidden` - true if hidden files should be served

    - #### StaticHandler setIndexPage(String indexPage)

      Set the index page

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `indexPage` - the index page

    - #### StaticHandler setMaxAgeSeconds(long maxAgeSeconds)

      Set value for max age in caching headers

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `maxAgeSeconds` - maximum time for browser to cache, in seconds

    - #### StaticHandler setMaxAvgServeTimeNs(long maxAvgServeTimeNanoSeconds)

      Set the max serve time in ns, above which serves are considered slow

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `maxAvgServeTimeNanoSeconds` - max serve time, in ns

    - #### StaticHandler setMaxCacheSize(int maxCacheSize)

      Set the max cache size, when caching is enabled

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `maxCacheSize` - the max cache size

    - #### StaticHandler setWebRoot(String webRoot)

      Set the web root

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `webRoot` - the web root