com.starteam
Class Content.WebCacheContent

java.lang.Object
  extended by com.starteam.Content.WebCacheContent
Enclosing class:
Content

public static final class Content.WebCacheContent
extends java.lang.Object

Content accessor for cached SDK content contained objects are obtained from the artifact cache


Method Summary
static Content.WebCacheContent fromBytes(ArtifactCacheManager.Context cntxt, byte[] bytes)
          Creates a content value from an in memory byte stream.
static Content.WebCacheContent fromBytes(ArtifactCacheManager.Context cntxt, byte[] bytes, Content.Type type)
          Creates a content value from an in memory byte stream.
 Content.Type getContentType()
          Gets the content type.
 int getID()
          if this Content instance represents an attachment, returns the associated attachment ID
 MD5 getMD5()
           
 java.lang.String getName()
          returns the advisory name (or description) of this content the name is typically associated with a rendering mechanism on the client, e.g.
 long getSize()
           
 void setContentType(Content.Type type)
          Sets the Content Type for this content.
 void setName(java.lang.String name)
          set an advisory name (or description) to be saved along with the content the name may typically be associated with a file name on the local platform and a rendering mechanism; e.g.
 byte[] toBytes()
          Given Content from the cache, return a byte[] containing the content data specific to the provided Content object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromBytes

public static Content.WebCacheContent fromBytes(ArtifactCacheManager.Context cntxt,
                                                byte[] bytes)
Creates a content value from an in memory byte stream. The content type is assumed to be CONTENT_TYPE_BINARY.

Parameters:
cntxt - The context of the operation
bytes - The byte array representing the content data.
Returns:
A new content value.

fromBytes

public static Content.WebCacheContent fromBytes(ArtifactCacheManager.Context cntxt,
                                                byte[] bytes,
                                                Content.Type type)
Creates a content value from an in memory byte stream.

Parameters:
cntxt - The context of the operation
bytes - The byte array representing the content data.
type - the content type
Returns:
A new content value.

toBytes

public byte[] toBytes()
Given Content from the cache, return a byte[] containing the content data specific to the provided Content object

Returns:
a byte[] containing Content data

getSize

public long getSize()
Returns:
The size of the content data, in bytes.
See Also:
Content.toFile(java.io.File), Content.WebCacheContent.getMD5()

getID

public int getID()
if this Content instance represents an attachment, returns the associated attachment ID

Returns:
the attachment ID or -1 if this is not content associated with an attachment

getName

public java.lang.String getName()
returns the advisory name (or description) of this content the name is typically associated with a rendering mechanism on the client, e.g. .doc, .pdf, etc.

Returns:
the advisory name (or description) of this content

setName

public void setName(java.lang.String name)
set an advisory name (or description) to be saved along with the content the name may typically be associated with a file name on the local platform and a rendering mechanism; e.g. .doc, .pdf, .gif.

Parameters:
name - an advisory name to be stored along with the content

getMD5

public MD5 getMD5()
Returns:
The MD5 signature of the content data.
See Also:
Content.WebCacheContent.getMD5()

setContentType

public void setContentType(Content.Type type)
Sets the Content Type for this content.

Parameters:
type - the Content Type.

getContentType

public Content.Type getContentType()
Gets the content type. The content type indicates how the content should be interpreted by a client application. The value is a string having the same format as the standard content-type HTTP/1.1 header, as defined in RFC 2616, section 14.17. The content type is advisory; no attempt is made to ensure that the data has any specific format.

Returns:
The content type.


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.