net.sf.beep4j
Class ProfileInfo

java.lang.Object
  extended by net.sf.beep4j.ProfileInfo

public final class ProfileInfo
extends java.lang.Object

Represents a profile as seen inside a start channel request.

Author:
Simon Raess

Constructor Summary
ProfileInfo(java.lang.String uri)
           
ProfileInfo(java.lang.String uri, byte[] data)
           
ProfileInfo(java.lang.String uri, java.lang.String content)
           
 
Method Summary
 void appendTo(java.lang.StringBuilder builder)
          Append the ProfileInfo content to the StringBuilder.
 byte[] getBinaryContent()
          Tries to retrieve the binary content.
 java.lang.String getContent()
          Tries to retrieve a the textual content.
 java.lang.String getUri()
          The profile URI, which should uniquely identify the profile.
 boolean hasContent()
          Determines whether this ProfileInfo has content.
 boolean isBase64Encoded()
          Determines whether the body was (or should be) base 64 encoded.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProfileInfo

public ProfileInfo(java.lang.String uri)

ProfileInfo

public ProfileInfo(java.lang.String uri,
                   byte[] data)

ProfileInfo

public ProfileInfo(java.lang.String uri,
                   java.lang.String content)
Method Detail

hasContent

public final boolean hasContent()
Determines whether this ProfileInfo has content.

Returns:
true iff there is content

getUri

public final java.lang.String getUri()
The profile URI, which should uniquely identify the profile.

Returns:
the URI of the profile

isBase64Encoded

public final boolean isBase64Encoded()
Determines whether the body was (or should be) base 64 encoded.

Returns:
true if base 64 encoded

getContent

public final java.lang.String getContent()
Tries to retrieve a the textual content. If no textual content is present an IllegalStateException is thrown.

Returns:
a textual content
Throws:
java.lang.IllegalStateException - if there is no textual content

getBinaryContent

public final byte[] getBinaryContent()
Tries to retrieve the binary content. If no binary content is present an IllegalStateException is thrown. The content returned is base64 decoded.

Returns:
the base64 decoded initialization data
Throws:
java.lang.IllegalStateException - if there is no binary data

appendTo

public final void appendTo(java.lang.StringBuilder builder)
Append the ProfileInfo content to the StringBuilder.

Parameters:
appendable - the StringBuilder to which the content is appended

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2007 null. All Rights Reserved.