/static folder is not traversed

  • Platform information:
    • Hardware: x86/4GB/3TB
    • OS: CentOS 7
    • Java Runtime Environment: Zulu 11
    • openHAB version: 3.3
  • Issue of the topic: folders under the Jetty Resource path “/static” are not traversed via links

when I attempt to browse archived video files via http://localhost:8080/static/archive/, I receive an error page containing
“Sorry Requested content not found
Debug Information:
Url: /static/archive/ipcamera1/
Path: /static/archive/ipcamera1/
Hash:
Params:
Query:
Route: (.*)”

Needless to say, I’m a bit baffled as to why Jetty will not traverse the folder structure.

$OPENHAB_CONF/html contains the following folder “archive”:

$ ls -al $OPENHAB_CONF/html/archive
total 16
drwxr-xr-x. 4 openhab openhab 4096 Aug 13 10:01 .
drwxr-xr-x. 4 openhab openhab 4096 Aug 13 10:12 …
drwxr-xr-x. 4 openhab openhab 4096 Aug 6 23:59 ipcamera1
drwxr-xr-x. 4 openhab openhab 4096 Aug 6 23:59 ipcamera2

and each of those folders contains “YYYYMMDD/” folders holding any recorded video files (MP4) from the specified camera (moved nightly by cron-scheduled script), such as

$ ls -al $OPENHAB_CONF/html/archive/ipcamera1
total 16
drwxr-xr-x. 4 openhab openhab 4096 Aug 6 23:59 .
drwxr-xr-x. 4 openhab openhab 4096 Aug 13 10:01 …
drwxr-xr-x. 2 openhab openhab 4096 Jul 4 22:13 20220704
drwxr-xr-x. 2 openhab openhab 4096 Aug 7 10:27 20220806

“$OPENHAB_CONF/html/index.html” contains the following snippet

  <tr>
<td>
Front Porch Camera Archive
</td>
<td>
<a href="./archive/ipcamera1/">listing</a>
</td>
  </tr>
  • Configuration - /usr/share/openhab/runtime/etc/jetty.xml contains the following active block:
        <Get name="handler">
                <Call name="addHandler">
                        <Arg>
                                <New class="org.eclipse.jetty.server.handler.ContextHandler">
                                        <Set name="contextPath">/static</Set>
                                        <Set name="handler">
                                                <New class="org.eclipse.jetty.server.handler.ResourceHandler">
                                                        <Set name="resourceBase"><SystemProperty name="openhab.conf" />/html</Set>
                                                        <Set name="directoriesListed">true</Set>
                                                </New>
                                        </Set>
                                </New>
                        </Arg>
                </Call>
        </Get>

NVM - generating HTML with distinct HREF links for each file will work, it will just be more clunky and IO-contentious.