01: // FLastModCommand.java
02: // $Id: FLastModCommand.java,v 1.4 2000/08/16 21:37:47 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1996.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.ssi.commands;
07:
08: import java.util.Date;
09: import java.util.Dictionary;
10:
11: import org.w3c.www.http.HTTP;
12:
13: import org.w3c.util.ArrayDictionary;
14: import org.w3c.util.TimeFormatter;
15:
16: import org.w3c.jigsaw.http.Reply;
17: import org.w3c.jigsaw.http.Request;
18:
19: import org.w3c.tools.resources.FileResource;
20:
21: import org.w3c.jigsaw.ssi.SSIFrame;
22:
23: /**
24: * Implementation of the standard <code>flastmod</code> SSI command.
25: * @author Antonio Ramirez <anto@mit.edu>
26: */
27: public class FLastModCommand extends BasicCommand {
28: private final static String NAME = "flastmod";
29:
30: public Reply execute(SSIFrame ssiframe, Request request,
31: ArrayDictionary parameters, Dictionary variables) {
32: Reply reply = ssiframe.createCommandReply(request, HTTP.OK);
33: reply.setContent(TimeFormatter.format(new Date(ssiframe
34: .getFileResource().getFile().lastModified()),
35: (String) variables.get("datefmt")));
36:
37: handleSimpleIMS(request, reply);
38: return reply;
39: }
40:
41: public String getName() {
42: return NAME;
43: }
44:
45: public String getValue(Dictionary variables, String variable,
46: Request request) {
47: return "null";
48: }
49:
50: }
|