diff options
Diffstat (limited to 'apps/samples/vrml/vrml-server.scxml')
-rw-r--r-- | apps/samples/vrml/vrml-server.scxml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/samples/vrml/vrml-server.scxml b/apps/samples/vrml/vrml-server.scxml index 0a66849..e08afd4 100644 --- a/apps/samples/vrml/vrml-server.scxml +++ b/apps/samples/vrml/vrml-server.scxml @@ -34,6 +34,21 @@ struct.key = _event.data.pathComponent.slice(1, _event.data.pathComponent.length - 1).join(pathDelim); if (struct.key.length > 0) struct.key += pathDelim; + + // support for meta file "latest.ext" + if (struct.file === "latest") { + var latestStamp = 0; + for (var key in models) { + if (key.substring(0, struct.key.length) == struct.key) { + if (models[key].ctime > latestStamp) { + var name = models[key].strippedName; + struct.file = name.substring(name.lastIndexOf(pathDelim) + 1); + latestStamp = models[key].ctime; + } + } + } + } + struct.key += struct.file; return struct; |