com.sapportals.wcm.util.content

Interface IContent

All Known Subinterfaces:
IContentFilter, IContentFilter2, IReadOnlyContentFilter
All Known Implementing Classes:
Content

public interface IContent

A resource implements this interface to provide content access.

This class provides access both to the actual content and the meta data related to it. This set of information MUST be consistent.

The following usage patterns need to be considered:

Accessing just the meta data: This is the typical call pattern when the client only needs the meta data, but won't actually read the content (for instance when displaying information about the members of a collection). In this case, getInputStream() will not be called. Note that implementations should avoid to internally open an input stream if the caller doesn't access it.

Accessing both content and meta data: This requires that the meta data returned accurately reflects the input stream that is returned and is the typical use case for an HTTP GET operation on the content (content length when known MUST be accurate). In this scenario, a client SHOULD call getInputStream() first, this allows the implementation to get a consistent set of meta data related to the input stream. If the client does not follow this recommended calling sequence, an implementation may have to signal a ContentException when it detects that meta data returned earlier does not match the actual data of the input stream opened. If the resource was deleted after the content object was created, the implementation SHOULD report a ResourceNotFoundException when trying to retrieve the input stream.

Copyright (c) SAP AG 2001-2003


Method Summary
 void close()
          Stop using this content object.
 long getContentLength()
          Returns the length of the resource content
 String getContentType()
          Returns the content type of the resource data
 String getEncoding()
          Returns the name of the character encoding of textual content
 InputStream getInputStream()
          Returns the input stream of the resource content.
 

Method Detail

getInputStream

public InputStream getInputStream()
                           throws ContentException
Returns the input stream of the resource content.

Returns:
The resource content as byte stream.
Throws:
ContentException

getContentLength

public long getContentLength()
                      throws ContentException
Returns the length of the resource content

Returns:
the length in bytes (when unknown: -1)
Throws:
ContentException

getContentType

public String getContentType()
                      throws ContentException
Returns the content type of the resource data

Returns:
The media subtype
Throws:
ContentException

getEncoding

public String getEncoding()
                   throws ContentException
Returns the name of the character encoding of textual content

Returns:
The name of the encoding (when unknown: null )
Throws:
ContentException - Exception raised in failure situation

close

public void close()
Stop using this content object.



Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.