01: /*
02: * Copyright 2004-2007 the original author or authors.
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: */
17:
18: package org.jpublish;
19:
20: import java.io.Reader;
21: import java.io.InputStream;
22: import java.io.Serializable;
23:
24: /** Interface which represents a single item of content. This interface
25: is read-only.
26:
27: @author Anthony Eden
28: @since 2.0
29: */
30:
31: public interface Content extends Serializable {
32:
33: /** Get the last-modified time of the content or -1 if it is not known.
34:
35: @return The last modified time
36: */
37:
38: public long getLastModified();
39:
40: /**
41: * last time this cache was flushed
42: * @return long
43: */
44: public long getLastFlush();
45:
46: /**
47: * set time when last flush occured
48: * @param lastFlush
49: */
50: public void setLastFlush(long lastFlush);
51:
52: /** Get an InputStream for reading the content data.
53:
54: @return The content InputStream
55: */
56:
57: public InputStream getInputStream();
58:
59: /** Get a Reader for reading the content data.
60:
61: @return The content Reader
62: */
63:
64: public Reader getReader();
65:
66: /** Get a Reader for readint the content data using the specified content
67: encoding.
68:
69: @param encoding The content encoding
70: @return The Reader
71: */
72:
73: public Reader getReader(String encoding);
74:
75: }
|