[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch: FYI: remove unused class
From: |
Tom Tromey |
Subject: |
Patch: FYI: remove unused class |
Date: |
23 Apr 2004 15:44:10 -0600 |
Eclipse had pointed out a buglet in this class, but closer
investigation showed that it is no longer needed. I'm removing it.
Tom
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.2104
diff -u -r1.2104 ChangeLog
--- ChangeLog 23 Apr 2004 21:36:23 -0000 1.2104
+++ ChangeLog 23 Apr 2004 21:54:06 -0000
@@ -1,5 +1,9 @@
2004-04-23 Tom Tromey <address@hidden>
+ * gnu/java/lang/ClassLoaderHelper.java: Removed.
+
+2004-04-23 Tom Tromey <address@hidden>
+
* java/lang/System.java (runFinalizersOnExit): Updated javadoc.
Cleaned up imports.
Index: gnu/java/lang/ClassLoaderHelper.java
===================================================================
RCS file: gnu/java/lang/ClassLoaderHelper.java
diff -N gnu/java/lang/ClassLoaderHelper.java
--- gnu/java/lang/ClassLoaderHelper.java 2 Dec 2003 09:12:07 -0000
1.8
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,136 +0,0 @@
-/* ClassLoaderHelper.java -- aids ClassLoader in finding resources
- Copyright (C) 1998, 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-
-package gnu.java.lang;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import gnu.java.io.PlatformHelper;
-
-/**
- * ClassLoaderHelper has various methods that ought to have been
- * in ClassLoader.
- *
- * @author John Keiser
- * @author Eric Blake <address@hidden>
- */
-public class ClassLoaderHelper
-{
- /**
- * Saves File instances mapping to specific absolute paths and jar urls.
- */
- private static final Hashtable fileResourceCache = new Hashtable();
-
- private static final int READBUFSIZE = 1024;
-
- /**
- * Searches the CLASSPATH for a resource and returns it as a File.
- *
- * @param name name of resource to locate
- *
- * @return a File object representing the resource, or null
- * if the resource could not be found
- */
- public static final File getSystemResourceAsFile(String name) {
- if (name.charAt(0) == '/')
- name = name.substring(1);
-
- String path = System.getProperty("java.class.path", ".");
- StringTokenizer st
- = new StringTokenizer(path, System.getProperty("path.separator", ":"));
- while (st.hasMoreElements())
- {
- String token = st.nextToken();
- File file;
- if (token.endsWith(".zip") || token.endsWith(".jar"))
- {
- file = new File(token);
- if (! file.exists())
- continue;
- path = file.getAbsolutePath();
- try
- {
- if (path.charAt(0) == '/')
- path = "jar:file:/" + path + "!/" + name;
- else
- path = "jar:file://" + path + "!/" + name;
- file = (File) fileResourceCache.get(path);
- if (file == null)
- {
- //load jar/zip entry from the url
- URL url = new URL(path);
- URLConnection urlconn = url.openConnection();
- InputStream is = urlconn.getInputStream();
- byte[] buf = new byte[READBUFSIZE];
- file = File.createTempFile("tmp", "", new File("."));
- FileOutputStream fos = new FileOutputStream(file);
- int len = 0;
- while ((len = is.read(buf)) != -1)
- fos.write(buf);
- fos.close();
- }
- }
- catch(Exception e)
- {
- continue;
- }
- }
- else
- {
- if (PlatformHelper.endWithSeparator(token))
- path = token + name;
- else
- path = token + File.separator + name;
- file = (File) fileResourceCache.get(path);
- if (file == null)
- file = new File(path);
- }
- if (file != null && file.isFile())
- {
- fileResourceCache.put(path, file);
- return file;
- }
- }
- return null;
- }
-} // class ClassLoaderHelper
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Patch: FYI: remove unused class,
Tom Tromey <=