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.
 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 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()


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