SAP NetWeaver '04

com.sapportals.wcm.repository
Class Content

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.framework_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.repository.Content
All Implemented Interfaces:
IContent, IEntityMetadata, IMutableEntityMetadata

public class Content
extends java.lang.Object
implements IContent, IMutableEntityMetadata

Access to the content data of a resource.

Copyright (c) SAP AG 2001-2002


Constructor Summary
Content(java.io.InputStream inputStream, java.lang.String mediaType, long contentLength)
          Constructs Content object, for use when encoding is not known separately but may be present in media type string.
Content(java.io.InputStream inputStream, java.lang.String mediaType, long contentLength, java.lang.String encoding)
          Constructs Content object, for use when media subtype and encoding are available as individual values.
Content(java.io.InputStream inputStream, java.lang.String mediaType, long contentLength, java.lang.String encoding, java.lang.String language)
          Constructs Content object, for use when media subtype and encoding are available as individual values.
 
Method Summary
 void close()
          Stop using this content object.
 long getContentLength()
          Returns the length of the resource content
 java.lang.String getContentType()
          Returns the content type of the resource data
 java.lang.String getEncoding()
          Returns the name of the character encoding of textual content
 java.lang.String getEntityTag()
          Returns the the entity-tag for the content (see RFC2616, section 3.11) and RFC2616, section 14.19).
 java.util.Date getExpiryDate()
           
 java.io.InputStream getInputStream()
          Returns the input stream of the resource content.
 java.lang.String getLanguage()
           
 java.util.Date getLastModified()
           
 void setEntityTag(java.lang.String entityTag)
           
 void setLastModified(java.util.Date lastModified)
           
 boolean wasUpdated()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Content

public Content(java.io.InputStream inputStream,
               java.lang.String mediaType,
               long contentLength,
               java.lang.String encoding)
Constructs Content object, for use when media subtype and encoding are available as individual values.
Parameters:
inputStream - input stream
mediaType - media type of content (trailing parameters are ignored)
contentLength - length of content (use -1 when unknown)
encoding - character encoding (use null when unknown)

Content

public Content(java.io.InputStream inputStream,
               java.lang.String mediaType,
               long contentLength,
               java.lang.String encoding,
               java.lang.String language)
Constructs Content object, for use when media subtype and encoding are available as individual values.
Parameters:
inputStream - input stream
mediaType - media type of content (trailing parameters are ignored)
contentLength - length of content (use -1 when unknown)
encoding - character encoding (use null when unknown)
language - content language (use null when unknown)

Content

public Content(java.io.InputStream inputStream,
               java.lang.String mediaType,
               long contentLength)
Constructs Content object, for use when encoding is not known separately but may be present in media type string.
Parameters:
inputStream - input stream
mediaType - media type of content (trailing parameters except encoding information is ignored)
contentLength - length of content (use -1 when unknown)
Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws ContentException
Description copied from interface: IContent
Returns the input stream of the resource content.
Specified by:
getInputStream in interface IContent
Following copied from interface: com.sapportals.wcm.util.content.IContent
Returns:
The resource content as byte stream.
Throws:
ContentException -  

getContentLength

public long getContentLength()
                      throws ContentException
Description copied from interface: IContent
Returns the length of the resource content
Specified by:
getContentLength in interface IContent
Following copied from interface: com.sapportals.wcm.util.content.IContent
Returns:
the length in bytes (when unknown: -1)
Throws:
ContentException -  

getContentType

public java.lang.String getContentType()
                                throws ContentException
Description copied from interface: IContent
Returns the content type of the resource data
Specified by:
getContentType in interface IContent
Following copied from interface: com.sapportals.wcm.util.content.IContent
Returns:
The media subtype
Throws:
ContentException -  

getEncoding

public java.lang.String getEncoding()
                             throws ContentException
Description copied from interface: IContent
Returns the name of the character encoding of textual content
Specified by:
getEncoding in interface IContent
Following copied from interface: com.sapportals.wcm.util.content.IContent
Returns:
The name of the encoding (when unknown: null )
Throws:
ContentException - Exception raised in failure situation

getEntityTag

public java.lang.String getEntityTag()
                              throws ResourceException
Description copied from interface: IEntityMetadata
Returns the the entity-tag for the content (see RFC2616, section 3.11) and RFC2616, section 14.19). Note that the entity tag may be a weak entity tag (indicated by a leading "W/"). Only strong entity tags can be used to assert octet-by-octet entity body identity, though.

The Format MUST be either:

Note that the double quotes are part of the entity tag.
Specified by:
getEntityTag in interface IEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IEntityMetadata
Returns:
entity tag or null when not known

setEntityTag

public void setEntityTag(java.lang.String entityTag)
                  throws ResourceException
Specified by:
setEntityTag in interface IMutableEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IMutableEntityMetadata
Parameters:
entityTag - entity-tag (see RFC2616 , section 14.19).
Throws:
ResourceException - Exception raised in failure situation

getExpiryDate

public java.util.Date getExpiryDate()
                             throws ResourceException
Specified by:
getExpiryDate in interface IEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IEntityMetadata
Returns:
the expiry date for the content (see RFC2616, section 14.21) or null when not specified

getLanguage

public java.lang.String getLanguage()
                             throws ResourceException
Specified by:
getLanguage in interface IEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IEntityMetadata
Returns:
the content language (see RFC2616, section 14.12) or null when not known

getLastModified

public java.util.Date getLastModified()
                               throws ResourceException
Specified by:
getLastModified in interface IEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IEntityMetadata
Returns:
the last modification date (see RFC2616, section 14.29) or null when not known

setLastModified

public void setLastModified(java.util.Date lastModified)
                     throws ResourceException
Specified by:
setLastModified in interface IMutableEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IMutableEntityMetadata
Parameters:
lastModified - last modified timestamp (see RFC2616 , section 14.29)
Throws:
ResourceException - Exception raised in failure situation

wasUpdated

public boolean wasUpdated()
Specified by:
wasUpdated in interface IMutableEntityMetadata
Following copied from interface: com.sapportals.wcm.repository.IMutableEntityMetadata
Returns:
whether the meta data was actually updated during the storage operation (create resource / update content).

close

public void close()
Description copied from interface: IContent
Stop using this content object.
Specified by:
close in interface IContent

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.