FELIX-1988 use AbstractWebConsolePlugin.readTemplateFile to load the template files

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@911279 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/internal/system/VMStatPlugin.java b/webconsole/src/main/java/org/apache/felix/webconsole/internal/system/VMStatPlugin.java
index 5b07923..edf69be 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/internal/system/VMStatPlugin.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/internal/system/VMStatPlugin.java
@@ -26,7 +26,6 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.felix.webconsole.DefaultVariableResolver;
 import org.apache.felix.webconsole.SimpleWebConsolePlugin;
 import org.apache.felix.webconsole.WebConsoleUtil;
@@ -71,18 +70,11 @@
     public VMStatPlugin()
     {
         super( LABEL, TITLE, CSS );
+
         // load templates
-        try
-        {
-            TPL_VM_MAIN = IOUtils.toString( getClass().getResourceAsStream( "/templates/vmstat.html" ), "UTF-8" );
-            TPL_VM_STOP = IOUtils.toString( getClass().getResourceAsStream( "/templates/vmstat_stop.html" ), "UTF-8" );
-            TPL_VM_RESTART = IOUtils.toString( getClass().getResourceAsStream( "/templates/vmstat_restart.html" ),
-                "UTF-8" );
-        }
-        catch ( IOException e )
-        {
-            throw new RuntimeException( e.toString() );
-        }
+        TPL_VM_MAIN = readTemplateFile(  "/templates/vmstat.html"  );
+        TPL_VM_STOP = readTemplateFile( "/templates/vmstat_stop.html" );
+        TPL_VM_RESTART = readTemplateFile( "/templates/vmstat_restart.html" );
     }