# Class: StaticHandler

## vertx-web-js/static_handler~ StaticHandler

#### new StaticHandler()

  A handler for serving static resources from the file system or classpath.
  Source:
    - static_handler.js, line 30

### Methods

#### handle(arg0)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `arg0` | RoutingContext |

  Source:
    - static_handler.js, line 40

#### setAlwaysAsyncFS(alwaysAsyncFS) → {StaticHandler}

  Set whether async filesystem access should always be used

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `alwaysAsyncFS` | boolean | true for always async FS access

  Source:
    - static_handler.js, line 189

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setCacheEntryTimeout(timeout) → {StaticHandler}

  Set the server cache entry timeout when caching is enabled

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `timeout` | number | the timeout, in ms

  Source:
    - static_handler.js, line 144

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setCachingEnabled(enabled) → {StaticHandler}

  Set whether cache header handling is enabled

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `enabled` | boolean | true if enabled

  Source:
    - static_handler.js, line 99

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setDirectoryListing(directoryListing) → {StaticHandler}

  Set whether directory listing is enabled

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `directoryListing` | boolean | true if enabled

  Source:
    - static_handler.js, line 114

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setDirectoryTemplate(directoryTemplate) → {StaticHandler}

  Set the directory template to be used when directory listing

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `directoryTemplate` | string | the directory template

  Source:
    - static_handler.js, line 234

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setEnableFSTuning(enableFSTuning) → {StaticHandler}

  Set whether async/sync filesystem tuning should enabled

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `enableFSTuning` | boolean | true to enabled FS tuning

  Source:
    - static_handler.js, line 204

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setFilesReadOnly(readOnly) → {StaticHandler}

  Set whether files are read-only and will never change

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `readOnly` | boolean | whether files are read-only

  Source:
    - static_handler.js, line 69

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setIncludeHidden(includeHidden) → {StaticHandler}

  Set whether hidden files should be served

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `includeHidden` | boolean | true if hidden files should be served

  Source:
    - static_handler.js, line 129

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setIndexPage(indexPage) → {StaticHandler}

  Set the index page

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `indexPage` | string | the index page

  Source:
    - static_handler.js, line 159

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setMaxAgeSeconds(maxAgeSeconds) → {StaticHandler}

  Set value for max age in caching headers

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `maxAgeSeconds` | number | maximum time for browser to cache, in seconds

  Source:
    - static_handler.js, line 84

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setMaxAvgServeTimeNs(maxAvgServeTimeNanoSeconds) → {StaticHandler}

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

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `maxAvgServeTimeNanoSeconds` | number | max serve time, in ns

  Source:
    - static_handler.js, line 219

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setMaxCacheSize(maxCacheSize) → {StaticHandler}

  Set the max cache size, when caching is enabled

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `maxCacheSize` | number | the max cache size

  Source:
    - static_handler.js, line 174

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler

#### setWebRoot(webRoot) → {StaticHandler}

  Set the web root

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `webRoot` | string | the web root

  Source:
    - static_handler.js, line 54

  ##### Returns:

  a reference to this, so the API can be used fluently
  Type
    StaticHandler