/usr/share/doc/libghc-happstack-server-doc/html/Happstack-Server-FileServe-BuildingBlocks.html is in libghc-happstack-server-doc 7.1.7-2build7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Happstack.Server.FileServe.BuildingBlocks</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Happstack-Server-FileServe-BuildingBlocks.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Happstack-Server-FileServe-BuildingBlocks.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">happstack-server-7.1.7: Web related tools and services.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Happstack.Server.FileServe.BuildingBlocks</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">High-Level
</a><ul><li><a href="#g:2">Serving files from a directory
</a></li><li><a href="#g:3">Serving a single file
</a></li></ul></li><li><a href="#g:4">Low-Level
</a></li><li><a href="#g:5">Content-Type / Mime-Type
</a></li><li><a href="#g:6">Directory Browsing
</a></li><li><a href="#g:7">Other
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Build your own file serving functions
</p><p>If the functions in <a href="Happstack-Server-FileServe.html">Happstack.Server.FileServe</a> do not quite do
you want you can roll your own by reusing pieces from this module.
</p><p>You will likely want to start by copying the source for a function
like, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code> and then modifying it to suit your needs.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:fileServe">fileServe</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:fileServe-39-">fileServe'</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:fileServeLazy">fileServeLazy</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:fileServeStrict">fileServeStrict</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:Browsing">Browsing</a> <ul class="subs"><li>= <a href="#v:EnableBrowsing">EnableBrowsing</a> </li><li>| <a href="#v:DisableBrowsing">DisableBrowsing</a> </li></ul></li><li class="src short"><a href="#v:serveDirectory">serveDirectory</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a> -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:serveDirectory-39-">serveDirectory'</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a> -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:serveFile">serveFile</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:serveFileFrom">serveFileFrom</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:serveFileUsing">serveFileUsing</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:sendFileResponse">sendFileResponse</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:lazyByteStringResponse">lazyByteStringResponse</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Lazy.html#t:ByteString">ByteString</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:strictByteStringResponse">strictByteStringResponse</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a>) -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a> -> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:filePathSendFile">filePathSendFile</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:filePathLazy">filePathLazy</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:filePathStrict">filePathStrict</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:MimeMap">MimeMap</a> = <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:mimeTypes">mimeTypes</a> :: <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a></li><li class="src short"><a href="#v:asContentType">asContentType</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:guessContentType">guessContentType</a> :: <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:guessContentTypeM">guessContentTypeM</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m => <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:EntryKind">EntryKind</a> <ul class="subs"><li>= <a href="#v:File">File</a> </li><li>| <a href="#v:Directory">Directory</a> </li><li>| <a href="#v:UnknownKind">UnknownKind</a> </li></ul></li><li class="src short"><a href="#v:browseIndex">browseIndex</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m, <a href="Happstack-Server-Response.html#t:ToMessage">ToMessage</a> b) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> m b) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:renderDirectoryContents">renderDirectoryContents</a> :: <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> m <a href="/usr/share/doc/libghc-blaze-html-doc/html/Text-Blaze-Html.html#t:Html">Html</a></li><li class="src short"><a href="#v:renderDirectoryContentsTable">renderDirectoryContentsTable</a> :: [(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a>, <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a>)] -> <a href="/usr/share/doc/libghc-blaze-html-doc/html/Text-Blaze-Html.html#t:Html">Html</a></li><li class="src short"><a href="#v:blockDotFiles">blockDotFiles</a> :: (<a href="Happstack-Server-Internal-Types.html#t:Request">Request</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:defaultIxFiles">defaultIxFiles</a> :: [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</li><li class="src short"><a href="#v:combineSafe">combineSafe</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><a href="#v:isSafePath">isSafePath</a> :: [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:tryIndex">tryIndex</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:doIndex">doIndex</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:doIndex-39-">doIndex'</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:doIndexLazy">doIndexLazy</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:doIndexStrict">doIndexStrict</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:fileNotFound">fileNotFound</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></li><li class="src short"><a href="#v:isDot">isDot</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1 id="g:1">High-Level
</h1><h2 id="g:2">Serving files from a directory
</h2><div class="top"><p class="src"><a name="v:fileServe" class="def">fileServe</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#fileServe" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>index file names, in case the requested path is a directory
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file/directory to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><div class="warning"><p>Deprecated: use serveDirectory instead.
</p></div><p>Serve files from a directory and its subdirectories using <code>sendFile</code>.
</p><p>Usage:
</p><pre> fileServe ["index.html"] "path/to/files/on/disk"
</pre><p><code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:fileServe">fileServe</a></code> does not support directory browsing. See <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code>
</p><p>DEPRECATED: use <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code> instead.
</p><p>Note:
</p><p>The list of index files <code>["index.html"]</code> is only used to determine what file to show if the user requests a directory. You *do not* need to explicitly list all the files you want to serve.
</p></div></div><div class="top"><p class="src"><a name="v:fileServe-39-" class="def">fileServe'</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#fileServe%27" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>)</td><td class="doc"><p>function which takes a content-type and filepath and generates a response (typically <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathSendFile">filePathSendFile</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathLazy">filePathLazy</a></code>, or <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathStrict">filePathStrict</a></code>)
</p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>)</td><td class="doc"><p>function which returns the mime-type for FilePath
-> [FilePath] -- ^ index file names, in case the requested path is a directory
</p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>)</td><td class="doc empty"> </td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file/directory to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Serve files from a directory and its subdirectories (parameterizable version)
</p><p>Parameterize this function to create functions like, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:fileServe">fileServe</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:fileServeLazy">fileServeLazy</a></code>, and <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:fileServeStrict">fileServeStrict</a></code>
</p><p>You supply:
</p><ol><li> a low-level function which takes a content-type and <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></code> and generates a Response
</li><li> a function which determines the content-type from the <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></code>
</li><li> a list of all the default index files
</li></ol><p>NOTE: unlike fileServe, there are no index files by default. See <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:defaultIxFiles">defaultIxFiles</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:fileServeLazy" class="def">fileServeLazy</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#fileServeLazy" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>index file names, in case the requested path is a directory
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file/directory to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Serve files from a directory and its subdirectories (lazy ByteString version).
</p><p>WARNING: May leak file handles. You should probably use <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:fileServe">fileServe</a></code> instead.
</p></div></div><div class="top"><p class="src"><a name="v:fileServeStrict" class="def">fileServeStrict</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#fileServeStrict" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>index file names, in case the next argument is a directory
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file/directory to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Serve files from a directory and its subdirectories (strict ByteString version).
</p><p>WARNING: the entire file will be read into RAM before being served. You should probably use <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:fileServe">fileServe</a></code> instead.
</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Browsing" class="def">Browsing</a> <a href="src/Happstack-Server-FileServe-BuildingBlocks.html#Browsing" class="link">Source</a></p><div class="doc"><p>see <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code>
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:EnableBrowsing" class="def">EnableBrowsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:DisableBrowsing" class="def">DisableBrowsing</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:Browsing" class="caption collapser" onclick="toggleSection('i:Browsing')">Instances</p><div id="section.i:Browsing" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Enum">Enum</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Read.html#t:Read">Read</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:serveDirectory" class="def">serveDirectory</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#serveDirectory" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc"><p>allow directory browsing
</p></td></tr><tr><td class="src">-> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>index file names, in case the requested path is a directory
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file/directory to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Serve files and directories from a directory and its subdirectories using <code>sendFile</code>.
</p><p>Usage:
</p><pre> serveDirectory EnableBrowsing ["index.html"] "path/to/files/on/disk"
</pre><p>If the requested path does not match a file or directory on the
disk, then <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code> calls <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#v:mzero">mzero</a></code>.
</p><p>If the requested path is a file then the file is served normally.
</p><p>If the requested path is a directory, then the result depends on
what the first two arguments to the function are.
</p><p>The first argument controls whether directory browsing is
enabled.
</p><p>The second argument is a list of index files (such as
index.html).
</p><p>When a directory is requested, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code> will first try to
find one of the index files (in the order they are listed). If that
fails, it will show a directory listing if <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:EnableBrowsing">EnableBrowsing</a></code> is set,
otherwise it will return <code>forbidden "Directory index forbidden"</code>.
</p><p>Here is an explicit list of all the possible outcomes when the
argument is a (valid) directory:
</p><dl><dt><code><code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:DisableBrowsing">DisableBrowsing</a></code>, empty index file list</code></dt><dd>
</dd></dl><p>This will always return, forbidden "Directory index forbidden"
</p><dl><dt><code><code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:DisableBrowsing">DisableBrowsing</a></code>, non-empty index file list</code></dt><dd>
</dd></dl><ol><li> If an index file is found it will be shown.
</li><li> Otherwise returns, forbidden "Directory index forbidden"
</li></ol><dl><dt><code><code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:EnableBrowsing">EnableBrowsing</a></code>, empty index file list</code></dt><dd>
</dd></dl><p>Always shows a directory index.
</p><dl><dt><code><code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:EnableBrowsing">EnableBrowsing</a></code>, non-empty index file list</code></dt><dd>
</dd></dl><ol><li> If an index file is found it will be shown
</li><li> Otherwise shows a directory index
</li></ol><p>see also: <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:defaultIxFiles">defaultIxFiles</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFile">serveFile</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:serveDirectory-39-" class="def">serveDirectory'</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#serveDirectory%27" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:WebMonad">WebMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:Browsing">Browsing</a></td><td class="doc"><p>allow directory browsing
</p></td></tr><tr><td class="src">-> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>index file names, in case the requested path is a directory
</p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>)</td><td class="doc"><p>function which returns the mime-type for FilePath
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file/directory to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>like <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveDirectory">serveDirectory</a></code> but with custom mimeTypes
</p></div></div><h2 id="g:3">Serving a single file
</h2><div class="top"><p class="src"><a name="v:serveFile" class="def">serveFile</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#serveFile" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>)</td><td class="doc"><p>function for determining content-type of file. Typically <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:asContentType">asContentType</a></code> or <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentTypeM">guessContentTypeM</a></code>
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to the file to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Serve a single, specified file. The name of the file being served is specified explicity. It is not derived automatically from the <code><a href="Happstack-Server-Internal-Types.html#t:Request">Request</a></code> url.
</p><p>example 1:
</p><p>Serve as a specific content-type:
</p><pre> serveFile (asContentType "image/jpeg") "/srv/data/image.jpg"
</pre><p>example 2:
</p><p>Serve guessing the content-type from the extension:
</p><pre> serveFile (guessContentTypeM mimeTypes) "/srv/data/image.jpg"
</pre><p>If the specified path does not exist or is not a file, this function will return <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#v:mzero">mzero</a></code>.
</p><p>WARNING: No security checks are performed.
</p><p>NOTE: alias for <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFileUsing">serveFileUsing</a></code> <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathSendFile">filePathSendFile</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:serveFileFrom" class="def">serveFileFrom</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#serveFileFrom" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>directory wherein served files must be contained
</p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>)</td><td class="doc"><p>function for determining content-type of file. Typically <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:asContentType">asContentType</a></code> or <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentTypeM">guessContentTypeM</a></code>
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to the file to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Like <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFile">serveFile</a></code>, but uses <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:combineSafe">combineSafe</a></code> to prevent directory
traversal attacks when the path to the file is supplied by the user.
</p></div></div><div class="top"><p class="src"><a name="v:serveFileUsing" class="def">serveFileUsing</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#serveFileUsing" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>)</td><td class="doc"><p>typically <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathSendFile">filePathSendFile</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathLazy">filePathLazy</a></code>, or <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathStrict">filePathStrict</a></code>
</p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>)</td><td class="doc"><p>function for determining content-type of file. Typically <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:asContentType">asContentType</a></code> or <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentTypeM">guessContentTypeM</a></code>
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to the file to serve
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Serve a single, specified file. The name of the file being served is specified explicity. It is not derived automatically from the <code><a href="Happstack-Server-Internal-Types.html#t:Request">Request</a></code> url.
</p><p>example 1:
</p><p>Serve using sendfile() and the specified content-type
</p><pre> serveFileUsing filePathSendFile (asContentType "image/jpeg") "/srv/data/image.jpg"
</pre><p>example 2:
</p><p>Serve using a lazy ByteString and the guess the content-type from the extension
</p><pre> serveFileUsing filePathLazy (guessContentTypeM mimeTypes) "/srv/data/image.jpg"
</pre><p>WARNING: No security checks are performed.
</p></div></div><h1 id="g:4">Low-Level
</h1><div class="top"><p class="src"><a name="v:sendFileResponse" class="def">sendFileResponse</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#sendFileResponse" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>content-type string
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>file path for content to send
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a>)</td><td class="doc"><p>mod-time for the handle (MUST NOT be later than server's time of message origination), incoming request (used to check for if-modified-since header)
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>offset into Handle
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>number of bytes to send
</p></td></tr><tr><td class="src">-> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Use sendFile to send the contents of a Handle
</p></div></div><div class="top"><p class="src"><a name="v:lazyByteStringResponse" class="def">lazyByteStringResponse</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#lazyByteStringResponse" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>content-type string (e.g. <code>"text/plain; charset=utf-8"</code>)
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString-Lazy.html#t:ByteString">ByteString</a></td><td class="doc"><p>lazy bytestring content to send
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a>)</td><td class="doc"><p>mod-time for the bytestring, incoming request (used to check for if-modified-since header)
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>offset into the bytestring
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>number of bytes to send (offset + count must be less than or equal to the length of the bytestring)
</p></td></tr><tr><td class="src">-> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Send the contents of a Lazy ByteString
</p></div></div><div class="top"><p class="src"><a name="v:strictByteStringResponse" class="def">strictByteStringResponse</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#strictByteStringResponse" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>content-type string (e.g. <code>"text/plain; charset=utf-8"</code>)
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>lazy bytestring content to send
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a>)</td><td class="doc"><p>mod-time for the bytestring, incoming request (used to check for if-modified-since header)
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>offset into the bytestring
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a></td><td class="doc"><p>number of bytes to send (offset + count must be less than or equal to the length of the bytestring)
</p></td></tr><tr><td class="src">-> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Send the contents of a Lazy ByteString
</p></div></div><div class="top"><p class="src"><a name="v:filePathSendFile" class="def">filePathSendFile</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#filePathSendFile" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>content-type string
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to file on disk
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Send the specified file with the specified mime-type using sendFile()
</p><p>NOTE: assumes file exists and is readable by the server. See <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFileUsing">serveFileUsing</a></code>.
</p><p>WARNING: No security checks are performed.
</p></div></div><div class="top"><p class="src"><a name="v:filePathLazy" class="def">filePathLazy</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#filePathLazy" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>content-type string
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to file on disk
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Send the specified file with the specified mime-type using lazy ByteStrings
</p><p>NOTE: assumes file exists and is readable by the server. See <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFileUsing">serveFileUsing</a></code>.
</p><p>WARNING: No security checks are performed.
</p></div></div><div class="top"><p class="src"><a name="v:filePathStrict" class="def">filePathStrict</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#filePathStrict" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>content-type string
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to file on disk
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Send the specified file with the specified mime-type using strict ByteStrings
</p><p>NOTE: assumes file exists and is readable by the server. See <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFileUsing">serveFileUsing</a></code>.
</p><p>WARNING: No security checks are performed.
</p></div></div><h1 id="g:5">Content-Type / Mime-Type
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:MimeMap" class="def">MimeMap</a> = <a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#MimeMap" class="link">Source</a></p><div class="doc"><p>a <code><a href="/usr/share/doc/ghc-doc/html/libraries/containers-0.5.0.0/Data-Map-Lazy.html#t:Map">Map</a></code> from file extensions to content-types
</p><p>example:
</p><pre> myMimeMap :: MimeMap
myMimeMap = Map.fromList [("gz","application/x-gzip"), ... ]
</pre><p>see also: <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:mimeTypes">mimeTypes</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:mimeTypes" class="def">mimeTypes</a> :: <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#mimeTypes" class="link">Source</a></p><div class="doc"><p>Ready collection of common mime types.
Except for the first two entries, the mappings come from an Ubuntu 8.04 /etc/mime.types file.
</p></div></div><div class="top"><p class="src"><a name="v:asContentType" class="def">asContentType</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#asContentType" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>the content-type to return
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>returns a specific content type, completely ignoring the <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></code> argument.
</p><p>Use this with <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFile">serveFile</a></code> if you want to explicitly specify the
content-type.
</p><p>see also: <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentTypeM">guessContentTypeM</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFile">serveFile</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:guessContentType" class="def">guessContentType</a> :: <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#guessContentType" class="link">Source</a></p><div class="doc"><p>try to guess the content-type of a file based on its extension
</p><p>see also: <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentTypeM">guessContentTypeM</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:guessContentTypeM" class="def">guessContentTypeM</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m => <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#guessContentTypeM" class="link">Source</a></p><div class="doc"><p>try to guess the content-type of a file based on its extension
</p><p>defaults to <a href="application/octet-stream.html">application/octet-stream</a> if no match was found.
</p><p>Useful as an argument to <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFile">serveFile</a></code>
</p><p>see also: <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentType">guessContentType</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:serveFile">serveFile</a></code>
</p></div></div><h1 id="g:6">Directory Browsing
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:EntryKind" class="def">EntryKind</a> <a href="src/Happstack-Server-FileServe-BuildingBlocks.html#EntryKind" class="link">Source</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:File" class="def">File</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:Directory" class="def">Directory</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a name="v:UnknownKind" class="def">UnknownKind</a></td><td class="doc empty"> </td></tr></table></div><div class="subs instances"><p id="control.i:EntryKind" class="caption collapser" onclick="toggleSection('i:EntryKind')">Instances</p><div id="section.i:EntryKind" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Enum">Enum</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Data.html#t:Data">Data</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Ord.html#t:Ord">Ord</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Read.html#t:Read">Read</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:browseIndex" class="def">browseIndex</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m, <a href="Happstack-Server-Response.html#t:ToMessage">ToMessage</a> b) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> m b) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#browseIndex" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:renderDirectoryContents" class="def">renderDirectoryContents</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#renderDirectoryContents" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m</td><td class="doc empty"> </td></tr><tr><td class="src">=> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>path to directory on disk
</p></td></tr><tr><td class="src">-> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>list of entries in that path
</p></td></tr><tr><td class="src">-> m <a href="/usr/share/doc/libghc-blaze-html-doc/html/Text-Blaze-Html.html#t:Html">Html</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>a function to generate an HTML page showing the contents of a directory on the disk
</p><p>see also: <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:browseIndex">browseIndex</a></code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:renderDirectoryContentsTable">renderDirectoryContentsTable</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:renderDirectoryContentsTable" class="def">renderDirectoryContentsTable</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#renderDirectoryContentsTable" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: [(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/time-1.4.0.1/Data-Time-Clock.html#t:UTCTime">UTCTime</a>, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Prelude.html#t:Integer">Integer</a>, <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:EntryKind">EntryKind</a>)]</td><td class="doc"><p>list of files+meta data, see <code>getMetaData</code>
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/libghc-blaze-html-doc/html/Text-Blaze-Html.html#t:Html">Html</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>a function to generate an HTML table showing the contents of a directory on the disk
</p><p>This function generates most of the content of the
<code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:renderDirectoryContents">renderDirectoryContents</a></code> page. If you want to style the page
differently, or add google analytics code, etc, you can just create
a new page template to wrap around this HTML.
</p><p>see also: <code>getMetaData</code>, <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:renderDirectoryContents">renderDirectoryContents</a></code>
</p></div></div><h1 id="g:7">Other
</h1><div class="top"><p class="src"><a name="v:blockDotFiles" class="def">blockDotFiles</a> :: (<a href="Happstack-Server-Internal-Types.html#t:Request">Request</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> <a href="Happstack-Server-Internal-Types.html#t:Request">Request</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#blockDotFiles" class="link">Source</a></p><div class="doc"><p>Prevents files of the form '.foo' or 'bar/.foo' from being served
</p></div></div><div class="top"><p class="src"><a name="v:defaultIxFiles" class="def">defaultIxFiles</a> :: [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]<a href="src/Happstack-Server-FileServe-BuildingBlocks.html#defaultIxFiles" class="link">Source</a></p><div class="doc"><p>a list of common index files. Specifically: <code>index.html</code>, <code>index.xml</code>, <code>index.gif</code>
</p><p>Typically used as an argument to <code>serveDiretory</code>.
</p></div></div><div class="top"><p class="src"><a name="v:combineSafe" class="def">combineSafe</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#combineSafe" class="link">Source</a></p><div class="doc"><p>Combine two <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></code>s, ensuring that the resulting path leads to
a file within the first <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></code>.
</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>combineSafe "/var/uploads/" "etc/passwd"
</code></strong>Just "/var/uploads/etc/passwd"
<code class="prompt">>>> </code><strong class="userinput"><code>combineSafe "/var/uploads/" "/etc/passwd"
</code></strong>Nothing
<code class="prompt">>>> </code><strong class="userinput"><code>combineSafe "/var/uploads/" "../../etc/passwd"
</code></strong>Nothing
<code class="prompt">>>> </code><strong class="userinput"><code>combineSafe "/var/uploads/" "../uploads/home/../etc/passwd"
</code></strong>Just "/var/uploads/etc/passwd"
</pre></div></div><div class="top"><p class="src"><a name="v:isSafePath" class="def">isSafePath</a> :: [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#isSafePath" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:tryIndex" class="def">tryIndex</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#tryIndex" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>)</td><td class="doc"><p>usually <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:filePathSendFile">filePathSendFile</a></code>
</p></td></tr><tr><td class="src">-> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>)</td><td class="doc"><p>function to calculate mime type, usually <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:guessContentTypeM">guessContentTypeM</a></code>
</p></td></tr><tr><td class="src">-> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>]</td><td class="doc"><p>list of index files. See also <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:defaultIxFiles">defaultIxFiles</a></code>
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>directory to search in
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>try to find an index file, calls mzero on failure
</p></div></div><div class="top"><p class="src"><a name="v:doIndex" class="def">doIndex</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#doIndex" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m)</td><td class="doc empty"> </td></tr><tr><td class="src">=> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a>]</td><td class="doc"><p>list of possible index files (e.g., <code>index.html</code>)
</p></td></tr><tr><td class="src">-> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a></td><td class="doc"><p>see also <code><a href="Happstack-Server-FileServe-BuildingBlocks.html#v:mimeTypes">mimeTypes</a></code>
</p></td></tr><tr><td class="src">-> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a></td><td class="doc"><p>directory on disk to search for index files
</p></td></tr><tr><td class="src">-> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a></td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>attempt to serve index files
</p></div></div><div class="top"><p class="src"><a name="v:doIndex-39-" class="def">doIndex'</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a>) -> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>) -> [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#doIndex%27" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:doIndexLazy" class="def">doIndexLazy</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#doIndexLazy" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:doIndexStrict" class="def">doIndexStrict</a> :: (<a href="Happstack-Server-Internal-Monads.html#t:ServerMonad">ServerMonad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m, <a href="/usr/share/doc/libghc-transformers-doc/html/Control-Monad-IO-Class.html#t:MonadIO">MonadIO</a> m, <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:MonadPlus">MonadPlus</a> m) => [<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a>] -> <a href="Happstack-Server-FileServe-BuildingBlocks.html#t:MimeMap">MimeMap</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#doIndexStrict" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:fileNotFound" class="def">fileNotFound</a> :: (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m, <a href="Happstack-Server-Internal-Monads.html#t:FilterMonad">FilterMonad</a> <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a> m) => <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:FilePath">FilePath</a> -> m <a href="Happstack-Server-Internal-Types.html#t:Response">Response</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#fileNotFound" class="link">Source</a></p><div class="doc"><p>return a simple <a href="File not found 404 page-.html">File not found 404 page.</a>
</p></div></div><div class="top"><p class="src"><a name="v:isDot" class="def">isDot</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Happstack-Server-FileServe-BuildingBlocks.html#isDot" class="link">Source</a></p><div class="doc"><p>Returns True if the given String either starts with a . or is of the form
<a href="foo/-bar.html">foo/.bar</a>, e.g. the typical *nix convention for hidden files.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|