CVS: plexus-container-new/src/java/org/apache/plexus/classloader PlexusClassLoader.java,1.1.1.1,1.2 ResourceManager.java,1.1.1.1,1.2

[email protected] Mon, 28 Apr 2003 07:39:40 -0500
Newsgroups gmane.comp.java.plexus.devel
Message-ID <[email protected]>
Update of /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/classloader
In directory eng.werken.com:/tmp/cvs-serv15201

Modified Files:
	PlexusClassLoader.java ResourceManager.java 
Log Message:
o Going to clean up the classloader/resource manager in prep for container hierarchies.

Index: PlexusClassLoader.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/classloader/PlexusClassLoader.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- PlexusClassLoader.java	29 Mar 2003 03:49:44 -0000	1.1.1.1
+++ PlexusClassLoader.java	28 Apr 2003 12:39:35 -0000	1.2
@@ -56,11 +56,6 @@
  * ----------------------------------------------------------------------------
  */
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringWriter;
 import java.net.URL;
 import java.net.URLClassLoader;
 
@@ -102,51 +97,5 @@
     public void addURL( URL url )
     {
         super.addURL( url );
-    }
-
-    /**
-     * Find the resource with the given name, and return a String.
-     * The search order is as described for <code>getResource()</code>,
-     * after checking to see if the resource data has been previously cached.
-     * If the resource cannot be found, return <code>null</code>.
-     *
-     * @param name Name of the resource to return a String for.
-     */
-    public String getResourceAsString( String name )
-    {
-        StringWriter sw = null;
-        BufferedReader reader = null;
-
-        try
-        {
-            sw = new StringWriter();
-            InputStream is = getResourceAsStream( name );
-            reader = new BufferedReader( new InputStreamReader( is ) );
-
-            char buf[] = new char[1024];
-            int len = 0;
-
-            while ( ( len = reader.read( buf, 0, 1024 ) ) != -1 )
-            {
-                sw.write( buf, 0, len );
-            }
-
-            return sw.toString();
-        }
-        catch ( IOException ioe )
-        {
-            return null;
-        }
-        finally
-        {
-            try
-            {
-                sw.close();
-                reader.close();
-            }
-            catch ( Exception ignored )
-            {
-            }
-        }
     }
 }

Index: ResourceManager.java
===================================================================
RCS file: /cvsroot/plexus/plexus-container-new/src/java/org/apache/plexus/classloader/ResourceManager.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- ResourceManager.java	29 Mar 2003 03:49:44 -0000	1.1.1.1
+++ ResourceManager.java	28 Apr 2003 12:39:35 -0000	1.2
@@ -224,12 +224,6 @@
     }
 
     /** Get a resource returned as a string. */
-    public String getResourceAsString( String resource )
-    {
-        return getClassLoader().getResourceAsString( resource );
-    }
-
-    /** Get a resource returned as a string. */
     public InputStream getResourceAsStream( String resource )
     {
         return getClassLoader().getResourceAsStream( resource );