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