aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-11-21 15:26:59 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-11-21 15:26:59 +0000
commita57cecb559519b23dee762a4be00d4ba738fb91b (patch)
tree072c1ac9c3cb66f7263953a86279f96aa6810ed7 /src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java
parent6cf18aba4a123923e89a5ce17964415e3c075c44 (diff)
downloadjitsi-a57cecb559519b23dee762a4be00d4ba738fb91b.zip
jitsi-a57cecb559519b23dee762a4be00d4ba738fb91b.tar.gz
jitsi-a57cecb559519b23dee762a4be00d4ba738fb91b.tar.bz2
Eliminates duplication among the ~28 Resources classes.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java')
-rw-r--r--src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java42
1 files changed, 4 insertions, 38 deletions
diff --git a/src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java b/src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java
index 63e9e3f..d761695 100644
--- a/src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java
+++ b/src/net/java/sip/communicator/plugin/dictaccregwizz/Resources.java
@@ -6,12 +6,7 @@
*/
package net.java.sip.communicator.plugin.dictaccregwizz;
-import java.io.*;
-
import net.java.sip.communicator.service.resources.*;
-import net.java.sip.communicator.util.*;
-
-import org.osgi.framework.*;
/**
* The <tt>Resources</tt> class manages the access to the internationalization
@@ -22,8 +17,6 @@ import org.osgi.framework.*;
*/
public class Resources
{
- private static Logger log = Logger.getLogger(Resources.class);
-
private static ResourceManagementService resourcesService;
public static ImageID DICT_LOGO = new ImageID("protocolIconDict");
@@ -48,42 +41,15 @@ public class Resources
*/
public static byte[] getImage(ImageID imageID)
{
- InputStream in =
- getResources().getImageInputStream(imageID.getId());
-
- if(in == null)
- return null;
-
- byte[] image = null;
-
- try
- {
- image = new byte[in.available()];
- in.read(image);
- }
- catch (IOException e)
- {
- log.error("Failed to load image:" + imageID, e);
- }
-
- return image;
+ return getResources().getImageInBytes(imageID.getId());
}
public static ResourceManagementService getResources()
{
if (resourcesService == null)
- {
- ServiceReference serviceReference = DictAccRegWizzActivator.bundleContext
- .getServiceReference(ResourceManagementService.class.getName());
-
- if(serviceReference == null)
- return null;
-
- resourcesService =
- (ResourceManagementService)DictAccRegWizzActivator.bundleContext
- .getService(serviceReference);
- }
-
+ resourcesService =
+ ResourceManagementServiceUtils
+ .getService(DictAccRegWizzActivator.bundleContext);
return resourcesService;
}
}