01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.catalina.ssi;
18:
19: import java.io.IOException;
20: import java.util.Collection;
21: import java.util.Date;
22:
23: /**
24: * Interface used by SSIMediator to talk to the 'outside world' ( usually a
25: * servlet )
26: *
27: * @author Dan Sandberg
28: * @version $Revision: 531303 $, $Date: 2007-04-23 02:24:01 +0200 (lun., 23 avr. 2007) $
29: */
30: public interface SSIExternalResolver {
31: /**
32: * Adds any external variables to the variableNames collection.
33: *
34: * @param variableNames
35: * the collection to add to
36: */
37: public void addVariableNames(Collection variableNames);
38:
39: public String getVariableValue(String name);
40:
41: /**
42: * Set the named variable to the specified value. If value is null, then
43: * the variable will be removed ( ie. a call to getVariableValue will
44: * return null )
45: *
46: * @param name
47: * of the variable
48: * @param value
49: * of the variable
50: */
51: public void setVariableValue(String name, String value);
52:
53: /**
54: * Returns the current date. This is useful for putting the SSI stuff in a
55: * regression test. Since you can make the current date a constant, it
56: * makes testing easier since the output won't change.
57: *
58: * @return the data
59: */
60: public Date getCurrentDate();
61:
62: public long getFileSize(String path, boolean virtual)
63: throws IOException;
64:
65: public long getFileLastModified(String path, boolean virtual)
66: throws IOException;
67:
68: public String getFileText(String path, boolean virtual)
69: throws IOException;
70:
71: public void log(String message, Throwable throwable);
72: }
|