SAP NetWeaver '04

com.sap.netweaver.bc.rf.common.content
Interface IContent

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.common_api.jar]
All Known Subinterfaces:
IMutableContent
All Known Implementing Classes:
Content

public interface IContent

Interface describing content a resource may provide.

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.


Method Summary
 IContentMetadata getContentMetadata()
          Get the content metadata.
 java.io.InputStream getInputStream()
          Get input stream for the resource content.
 

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws ResourceException
Get input stream for the resource content.
Returns:
input stream for the resource content
Throws:
ResourceException - when the operation failed

getContentMetadata

public IContentMetadata getContentMetadata()
                                    throws ResourceException
Get the content metadata.
Returns:
content metadata
Throws:
ResourceException - when the operation failed

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
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.