com.beem.project.beem.smack.avatar
Class FileAvatarCache

Package class diagram package FileAvatarCache
java.lang.Object
  extended by com.beem.project.beem.smack.avatar.FileAvatarCache
All Implemented Interfaces:
AvatarCache

public class FileAvatarCache
extends Object
implements AvatarCache

An implementation of an AvatarCache which store the data of the filesystem.


Constructor Summary
FileAvatarCache(File storedir)
          Create a FileAvatarCache.
 
Method Summary
 boolean contains(String key)
          Test if a data is in cache.
 byte[] get(String key)
          Get some data from the cache.
 void put(String key, byte[] data)
          Put some datas in cache.
 void put(String key, InputStream in)
          Put some datas in cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAvatarCache

public FileAvatarCache(File storedir)
Create a FileAvatarCache.

Parameters:
storedir - The directory used to store the data.
Method Detail

put

public void put(String key,
                byte[] data)
         throws IOException
Description copied from interface: AvatarCache
Put some datas in cache.

Specified by:
put in interface AvatarCache
Parameters:
key - the key id of the data
data - the data to cache
Throws:
IOException - if an IO error occurs while caching the data

put

public void put(String key,
                InputStream in)
         throws IOException
Description copied from interface: AvatarCache
Put some datas in cache.

Specified by:
put in interface AvatarCache
Parameters:
key - the key id of the data
in - an InputStream to the data to cache
Throws:
IOException - if an IO error occurs while caching the data

get

public byte[] get(String key)
           throws IOException
Description copied from interface: AvatarCache
Get some data from the cache.

Specified by:
get in interface AvatarCache
Parameters:
key - the id of the data to get
Returns:
the cached data
Throws:
IOException - if an IO error occurs while geting the data

contains

public boolean contains(String key)
Description copied from interface: AvatarCache
Test if a data is in cache.

Specified by:
contains in interface AvatarCache
Parameters:
key - the id of the data
Returns:
true if data is in cache false otherwise


Copyright © 2009 Beem-project.com. All Rights Reserved.