This file is indexed.

/usr/share/doc/libpion-doc/html/classpion_1_1plugins_1_1_file_service.html is in libpion-doc 5.0.4+dfsg-2.

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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!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/xhtml;charset=UTF-8"/>
<title>pion: pion::plugins::FileService Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><b>pion</b>::<b>plugins</b>::<a class="el" href="classpion_1_1plugins_1_1_file_service.html">FileService</a>
  </div>
</div>
<div class="contents">
<h1>pion::plugins::FileService Class Reference</h1><!-- doxytag: class="pion::plugins::FileService" --><!-- doxytag: inherits="pion::http::plugin_service" -->
<p><code>#include &lt;<a class="el" href="_file_service_8hpp_source.html">FileService.hpp</a>&gt;</code></p>

<p>Inherits <a class="el" href="classpion_1_1http_1_1plugin__service.html">pion::http::plugin_service</a>.</p>

<p><a href="classpion_1_1plugins_1_1_file_service-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a9a2e7ce1dd455a7213bae7c2e47e8a13">set_option</a> (const std::string &amp;name, const std::string &amp;value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98a2a90a2a8846e94c737a34902644fc"></a><!-- doxytag: member="pion::plugins::FileService::operator()" ref="a98a2a90a2a8846e94c737a34902644fc" args="(pion::http::request_ptr &amp;http_request_ptr, pion::tcp::connection_ptr &amp;tcp_conn)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a98a2a90a2a8846e94c737a34902644fc">operator()</a> (pion::http::request_ptr &amp;http_request_ptr, pion::tcp::connection_ptr &amp;tcp_conn)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">handles requests for <a class="el" href="classpion_1_1plugins_1_1_file_service.html">FileService</a> <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9ba023821844c174e268d4c04a0ee2bc"></a><!-- doxytag: member="pion::plugins::FileService::start" ref="a9ba023821844c174e268d4c04a0ee2bc" args="(void)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a9ba023821844c174e268d4c04a0ee2bc">start</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">called when the web service's server is starting <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a99259cf6308a2745943f4e6e45976c26"></a><!-- doxytag: member="pion::plugins::FileService::stop" ref="a99259cf6308a2745943f4e6e45976c26" args="(void)" -->
virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a99259cf6308a2745943f4e6e45976c26">stop</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">called when the web service's server is stopping <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a33990e40c5c80e10b70ea29dc5bfaba3"></a><!-- doxytag: member="pion::plugins::FileService::set_logger" ref="a33990e40c5c80e10b70ea29dc5bfaba3" args="(logger log_ptr)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a33990e40c5c80e10b70ea29dc5bfaba3">set_logger</a> (logger log_ptr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">sets the logger to be used <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeb189cb25aacc0ad89031043610c751e"></a><!-- doxytag: member="pion::plugins::FileService::get_logger" ref="aeb189cb25aacc0ad89031043610c751e" args="(void)" -->
logger&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#aeb189cb25aacc0ad89031043610c751e">get_logger</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns the logger currently in use <br/></td></tr>
<tr><td colspan="2"><h2>Protected Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a06d3f20537e992038c15ed362470b5af"></a><!-- doxytag: member="pion::plugins::FileService::CacheMap" ref="a06d3f20537e992038c15ed362470b5af" args="" -->
typedef PION_HASH_MAP<br class="typebreak"/>
&lt; std::string, <a class="el" href="classpion_1_1plugins_1_1_disk_file.html">DiskFile</a>, <br class="typebreak"/>
PION_HASH_STRING &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a06d3f20537e992038c15ed362470b5af">CacheMap</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">data type for map of file names to cache entries <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad39a3a2dd8b7f6753093e803c76b5b36"></a><!-- doxytag: member="pion::plugins::FileService::MIMETypeMap" ref="ad39a3a2dd8b7f6753093e803c76b5b36" args="" -->
typedef PION_HASH_MAP<br class="typebreak"/>
&lt; std::string, std::string, <br class="typebreak"/>
PION_HASH_STRING &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#ad39a3a2dd8b7f6753093e803c76b5b36">MIMETypeMap</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">data type for map of file extensions to MIME types <br/></td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a846472efdb9cf091b66ac941863bbc65">scanDirectory</a> (const boost::filesystem::path &amp;dir_path)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::pair&lt; CacheMap::iterator, <br class="typebreak"/>
bool &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#accda870fc20d08e689e394dc3d780eef">addCacheEntry</a> (const std::string &amp;relative_path, const boost::filesystem::path &amp;file_path, const bool placeholder)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab701cf982801ca3b88a7681b69e3ec54"></a><!-- doxytag: member="pion::plugins::FileService::sendNotFoundResponse" ref="ab701cf982801ca3b88a7681b69e3ec54" args="(pion::http::request_ptr &amp;http_request_ptr, pion::tcp::connection_ptr &amp;tcp_conn)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>sendNotFoundResponse</b> (pion::http::request_ptr &amp;http_request_ptr, pion::tcp::connection_ptr &amp;tcp_conn)</td></tr>
<tr><td colspan="2"><h2>Static Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a80482b4687642f4d777956c73de6a3e6">findMIMEType</a> (const std::string &amp;file_name)</td></tr>
<tr><td colspan="2"><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6ca4dbf4a8c1658f330a034842d12b89"></a><!-- doxytag: member="pion::plugins::FileService::m_logger" ref="a6ca4dbf4a8c1658f330a034842d12b89" args="" -->
logger&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpion_1_1plugins_1_1_file_service.html#a6ca4dbf4a8c1658f330a034842d12b89">m_logger</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">primary logging interface used by this class <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="classpion_1_1plugins_1_1_file_service.html">FileService</a>: web service that serves regular files </p>

<p>Definition at line <a class="el" href="_file_service_8hpp_source.html#l00235">235</a> of file <a class="el" href="_file_service_8hpp_source.html">FileService.hpp</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="accda870fc20d08e689e394dc3d780eef"></a><!-- doxytag: member="pion::plugins::FileService::addCacheEntry" ref="accda870fc20d08e689e394dc3d780eef" args="(const std::string &amp;relative_path, const boost::filesystem::path &amp;file_path, const bool placeholder)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::pair&lt; FileService::CacheMap::iterator, bool &gt; pion::plugins::FileService::addCacheEntry </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>relative_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const boost::filesystem::path &amp;&nbsp;</td>
          <td class="paramname"> <em>file_path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const bool&nbsp;</td>
          <td class="paramname"> <em>placeholder</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>adds a single file to the cache</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>relative_path</em>&nbsp;</td><td>path for the file relative to the root directory </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>file_path</em>&nbsp;</td><td>actual path to the file on disk </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>placeholder</em>&nbsp;</td><td>if true, the file's contents are not cached</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>std::pair&lt;CacheMap::iterator, bool&gt; if an entry is added to the cache, second will be true and first will point to the new entry </dd></dl>

<p>Definition at line <a class="el" href="_file_service_8cpp_source.html#l00660">660</a> of file <a class="el" href="_file_service_8cpp_source.html">FileService.cpp</a>.</p>

<p>References <a class="el" href="_file_service_8cpp_source.html#l00711">findMIMEType()</a>, <a class="el" href="_file_service_8hpp_source.html#l00081">pion::plugins::DiskFile::getFileSize()</a>, <a class="el" href="_file_service_8hpp_source.html#l00315">m_logger</a>, <a class="el" href="_file_service_8cpp_source.html#l00762">pion::plugins::DiskFile::read()</a>, and <a class="el" href="_file_service_8cpp_source.html#l00754">pion::plugins::DiskFile::update()</a>.</p>

<p>Referenced by <a class="el" href="_file_service_8cpp_source.html#l00620">scanDirectory()</a>, and <a class="el" href="_file_service_8cpp_source.html#l00587">start()</a>.</p>

</div>
</div>
<a class="anchor" id="a80482b4687642f4d777956c73de6a3e6"></a><!-- doxytag: member="pion::plugins::FileService::findMIMEType" ref="a80482b4687642f4d777956c73de6a3e6" args="(const std::string &amp;file_name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string pion::plugins::FileService::findMIMEType </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>file_name</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [static, protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>searches for a MIME type that matches a file</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>file_name</em>&nbsp;</td><td>name of the file to search for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>MIME type corresponding with the file, or DEFAULT_MIME_TYPE if none found </dd></dl>

<p>Definition at line <a class="el" href="_file_service_8cpp_source.html#l00711">711</a> of file <a class="el" href="_file_service_8cpp_source.html">FileService.cpp</a>.</p>

<p>Referenced by <a class="el" href="_file_service_8cpp_source.html#l00660">addCacheEntry()</a>, and <a class="el" href="_file_service_8cpp_source.html#l00117">operator()()</a>.</p>

</div>
</div>
<a class="anchor" id="a846472efdb9cf091b66ac941863bbc65"></a><!-- doxytag: member="pion::plugins::FileService::scanDirectory" ref="a846472efdb9cf091b66ac941863bbc65" args="(const boost::filesystem::path &amp;dir_path)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pion::plugins::FileService::scanDirectory </td>
          <td>(</td>
          <td class="paramtype">const boost::filesystem::path &amp;&nbsp;</td>
          <td class="paramname"> <em>dir_path</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>adds all files within a directory to the cache</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dir_path</em>&nbsp;</td><td>the directory to scan (sub-directories are included) </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_file_service_8cpp_source.html#l00620">620</a> of file <a class="el" href="_file_service_8cpp_source.html">FileService.cpp</a>.</p>

<p>References <a class="el" href="_file_service_8cpp_source.html#l00660">addCacheEntry()</a>, <a class="el" href="plugin__service_8hpp_source.html#l00068">pion::http::plugin_service::get_resource()</a>, and <a class="el" href="_file_service_8hpp_source.html#l00315">m_logger</a>.</p>

<p>Referenced by <a class="el" href="_file_service_8cpp_source.html#l00587">start()</a>.</p>

</div>
</div>
<a class="anchor" id="a9a2e7ce1dd455a7213bae7c2e47e8a13"></a><!-- doxytag: member="pion::plugins::FileService::set_option" ref="a9a2e7ce1dd455a7213bae7c2e47e8a13" args="(const std::string &amp;name, const std::string &amp;value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void pion::plugins::FileService::set_option </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>value</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>configuration options supported by <a class="el" href="classpion_1_1plugins_1_1_file_service.html">FileService</a>:</p>
<p>directory: all files within the directory will be made available file: cache: scan: max_chunk_size: writable: </p>

<p>Reimplemented from <a class="el" href="classpion_1_1http_1_1plugin__service.html#a49cddd4c2a99e276373b5f7162ff3cde">pion::http::plugin_service</a>.</p>

<p>Definition at line <a class="el" href="_file_service_8cpp_source.html#l00053">53</a> of file <a class="el" href="_file_service_8cpp_source.html">FileService.cpp</a>.</p>

<p>References <a class="el" href="plugin_8cpp_source.html#l00048">pion::plugin::check_cygwin_path()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>services/<a class="el" href="_file_service_8hpp_source.html">FileService.hpp</a></li>
<li>services/<a class="el" href="_file_service_8cpp_source.html">FileService.cpp</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 16 Sep 2013 for pion by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>