jarp
Class AvatarStreamManager

java.lang.Object
  extended by jarp.AvatarStreamManager

public class AvatarStreamManager
extends java.lang.Object

An avatar stream manager provides the input stream needed to load an avatar given a URL for the avatar definition file. In most cases this is an essentially trivial task, but in the case of an HTTP URL, the manager first downloads a local copy of the avatar data asynchronously before providing an input stream on this local copy.


Nested Class Summary
static interface AvatarStreamManager.ASMClient
          Callback interface for an Avatar Stream Manager's client.
 
Constructor Summary
AvatarStreamManager(JAOptions jaopts, AvatarStreamManager.ASMClient client, java.lang.String av, java.lang.String avnonstdurl)
          Constructs a new AvatarStreamManager for the avatar determined by the given avatar name and non-standard (overriding) URL, using the given JA Options settings and using the given client for notification if necessary.
 
Method Summary
 java.io.InputStream getAvatarStream()
          Provided isFinished() holds, this method returns an input stream for the avatar definition handled by this manager, or throws an IOException if it was not possible to obtain a stream for the avatar definition.
 java.lang.String getAvatarURL()
          Returns the URL for the avatar definition file handled by this manager, provided that URL is valid; returns null otherwise.
 boolean isFinished()
          Indicates whether or not the attempt to establish an input stream for the avatar is completed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvatarStreamManager

public AvatarStreamManager(JAOptions jaopts,
                           AvatarStreamManager.ASMClient client,
                           java.lang.String av,
                           java.lang.String avnonstdurl)
Constructs a new AvatarStreamManager for the avatar determined by the given avatar name and non-standard (overriding) URL, using the given JA Options settings and using the given client for notification if necessary.

Method Detail

isFinished

public boolean isFinished()
Indicates whether or not the attempt to establish an input stream for the avatar is completed.


getAvatarURL

public java.lang.String getAvatarURL()
Returns the URL for the avatar definition file handled by this manager, provided that URL is valid; returns null otherwise.


getAvatarStream

public java.io.InputStream getAvatarStream()
                                    throws java.io.IOException
Provided isFinished() holds, this method returns an input stream for the avatar definition handled by this manager, or throws an IOException if it was not possible to obtain a stream for the avatar definition.

Throws:
java.io.IOException