View Javadoc

1   /*
2    * Copyright 2000-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.portals.graffito.model;
17  
18  import java.io.InputStream;
19  
20  
21  
22  /***
23   * CMS content interface.
24   *
25   * @author <a href="mailto:christophe.lombart">Christophe Lombart</a>
26   * @version $Id: Content.java,v 1.1 2004/12/22 21:16:10 christophe Exp $
27   */
28  public interface Content extends Cloneable
29  {
30      /***
31       * @return Returns the content.
32       */
33      public InputStream getContentStream();
34      
35      
36      /***
37       * @return Returns the content.
38       */
39      public byte[] getContentByte();
40      
41      /***
42       * @return Returns the content in the String format
43       */
44      public String getContentAsString();
45      
46      /***
47       * @param stream The content to set.
48       */    
49      public void setContent(InputStream stream);
50      
51      
52      /***
53       * @param content The content to set.
54       */
55      public void setContent(byte[] content);
56   
57      /***
58       * @return Returns the encoding.
59       */
60      public String getEncoding();
61  
62      /***
63       * @param encoding The encoding to set.
64       */
65      public void setEncoding(String encoding);
66  
67      /***
68       *  Clone the content object
69       *  @return the new clone instante created
70       */
71      Object clone();
72  }
73