summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/isode/stroke/avatars/DummyAvatarManager.java')
-rwxr-xr-xsrc/com/isode/stroke/avatars/DummyAvatarManager.java36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/com/isode/stroke/avatars/DummyAvatarManager.java b/src/com/isode/stroke/avatars/DummyAvatarManager.java
new file mode 100755
index 0000000..f1dfe41
--- /dev/null
+++ b/src/com/isode/stroke/avatars/DummyAvatarManager.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+/*
+ * Copyright (c) 2015 Tarun Gupta.
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+package com.isode.stroke.avatars;
+
+import com.isode.stroke.avatars.AvatarManager;
+import com.isode.stroke.base.ByteArray;
+import com.isode.stroke.jid.JID;
+import java.nio.file.*;
+import java.io.File;
+import java.util.*;
+
+public class DummyAvatarManager implements AvatarManager {
+
+ private Map<JID, ByteArray> avatars = new HashMap<JID, ByteArray>();
+
+ public Path getAvatarPath(JID j) {
+ return (Paths.get("/avatars" + File.separator + j.toString())).toAbsolutePath();
+ }
+
+ public ByteArray getAvatar(JID jid) {
+ if(avatars.containsKey(jid)) {
+ return avatars.get(jid);
+ } else {
+ return new ByteArray();
+ }
+ }
+} \ No newline at end of file