KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > environment > Source


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.cocoon.environment;
17
18 import org.apache.avalon.excalibur.pool.Recyclable;
19 import org.apache.cocoon.ProcessingException;
20 import org.apache.excalibur.xml.sax.XMLizable;
21 import org.xml.sax.InputSource JavaDoc;
22
23 import java.io.IOException JavaDoc;
24 import java.io.InputStream JavaDoc;
25
26 /**
27  * Description of a source. This interface provides a simple interface
28  * for accessing a source of data. The source of data is assumed to
29  * <b>not change</b> during the lifetime of the Source object. If you
30  * have a data source that can change its content and you want it to
31  * reflect in Cocoon, use a {@link ModifiableSource} object instead.
32  *
33  * @deprecated Use the {@link org.apache.excalibur.source.Source} interface instead
34  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
35  * @author <a HREF="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
36  * @version CVS $Id: Source.java 30932 2004-07-29 17:35:38Z vgritsenko $
37  */

38
39 public interface Source extends Recyclable, XMLizable {
40   /**
41    * Get the last modification date of the source or 0 if it
42    * is not possible to determine the date.
43    */

44   long getLastModified();
45
46   /**
47    * Get the content length of the source or -1 if it
48    * is not possible to determine the length.
49    */

50   long getContentLength();
51
52   /**
53    * Return an <code>InputStream</code> object to read from the source.
54    */

55   InputStream JavaDoc getInputStream()
56     throws ProcessingException, IOException JavaDoc;
57
58   /**
59    * Return an <code>InputSource</code> object to read the XML
60    * content.
61    *
62    * @return an <code>InputSource</code> value
63    * @exception ProcessingException if an error occurs
64    * @exception IOException if an error occurs
65    */

66   InputSource JavaDoc getInputSource()
67     throws ProcessingException, IOException JavaDoc;
68
69   /**
70    * Return the unique identifer for this source
71    */

72   String JavaDoc getSystemId();
73 }
74
Popular Tags